This application uses OAuth 2.0 with PKCE for authentication with CILogon, ORCID, and FABRIC API. Each provider requires proper configuration of redirect URIs in your OAuth application settings.
The error you're seeing:
Failed to initialize OIDC flow. The given redirect_uri is not valid for this client.
This occurs because the redirect URI in your OAuth application configuration doesn't match the current deployment URL.
You need to update the redirect URIs in each OAuth provider's configuration:
Current registered URI: https://lmarinve.github.io/multi-provider-authe/auth/callback/cilogon
Required URI for current deployment:
- For Spark development: The URI will be automatically determined based on your current deployment URL
- Format:
{DEPLOYMENT_URL}/auth/callback/cilogon.html
Steps to update:
- Go to your CILogon client configuration
- Update the redirect URI to match your current deployment URL
- Ensure the client ID matches:
cilogon:/client_id/e33e29a20f84e0edd144d1e9a6e2b0 - Confirm scopes are set to:
openid(only openid, as your client has Strict Scopes = true)
Current registered URI: https://lmarinve.github.io/multi-provider-authe/auth/callback/orcid
Required URI for current deployment:
- Format:
{DEPLOYMENT_URL}/auth/callback/orcid.html
Steps to update:
- Go to your ORCID application configuration
- Update the redirect URI to match your current deployment URL
- Ensure the client ID matches:
APP-S3BU1LVHOTHITEU2 - Confirm scopes are set to:
/authenticate
To find your current deployment URL:
-
In Spark Development Environment:
- The URL will be provided when you run the development server
- It typically looks like:
https://[unique-id].app.github.dev
-
In Production:
- Use your actual production domain
The application includes callback pages at:
/auth/callback/cilogon.html- Handles CILogon OAuth callbacks/auth/callback/orcid.html- Handles ORCID OAuth callbacks
These pages:
- Process the OAuth response
- Extract the authorization code and state
- Send the data back to the main application
- Handle error cases gracefully
After updating your redirect URIs:
- Try the CILogon authentication flow
- Check that the popup opens successfully
- Complete authentication in the popup
- Verify the token is received and stored
If you see "This content is blocked" or "refused to connect":
- This usually means the OAuth provider is blocking the request
- Ensure your redirect URIs are exactly correct (including the
.htmlextension) - Try testing in an incognito window
- Ensure popups are allowed for your domain
- Try disabling popup blockers temporarily for testing
- OAuth flows with popup windows can have CORS restrictions
- The callback pages are designed to work around common CORS issues
- Uses PKCE with S256 method (required)
- Only supports
openidscope due to Strict Scopes setting - Requires exact redirect URI match (case-sensitive)
- Uses PKCE with S256 method
- Supports
/authenticatescope - May have additional CORS restrictions
- Requires a valid CILogon token first
- Uses token exchange rather than direct OAuth
- Update your OAuth applications with the correct redirect URIs for your current deployment
- Test each authentication flow to ensure they work properly
- Monitor the browser console for any remaining error messages
The authentication should work properly once the redirect URIs are correctly configured in your OAuth applications.