OIDC
Warnly integrates with OIDC providers to authenticate users. Once configured, users can log in using their OIDC credentials, and Warnly will automatically create user accounts and manage access based on the configured settings.Configuration
To enable OIDC authentication, set the following environment variables:| Property | Description | Required |
|---|---|---|
| OIDC_PROVIDER_NAME | Name of the OIDC provider (e.g., ‘google’, ‘keycloak’) | Yes |
| OIDC_ISSUER_URL | OIDC issuer URL | Yes |
| OIDC_CLIENT_ID | OIDC client ID | Yes |
| OIDC_CLIENT_SECRET | OIDC client secret | Yes |
| OIDC_REDIRECT_ADDRESS | Public URL on which Warnly instance is reachable | Yes |
| OIDC_SCOPES | Space-separated list of OIDC scopes (default: ‘openid email profile’) | No |
| OIDC_EMAIL_MATCHES | Space-separated list of email regex patterns for user filtering | No |
| OIDC_USE_PKCE | Enable PKCE for OIDC authentication flow (default: true) | No |
Callback URL
When configuring your OIDC provider, you need to set the callback URL to:{provider_name} with the value of OIDC_PROVIDER_NAME.
Email Matches
You can restrict access to specific users by configuring email patterns. Only users whose email addresses match the provided regular expressions will be allowed to authenticate. For example, to allow only users with@yourcompany.com emails:
Example: OIDC with Keycloak
- In your Keycloak admin console, create a new client
- Set the client type to “OpenID Connect”
- Configure the redirect URI:
https://your-warnly-instance.com/oidc/keycloak/callback - Enable “Standard flow” and “Direct access grants”
- Configure the following environment variables:
Troubleshooting
Common Issues
-
Invalid redirect URI: Ensure the callback URL in your OIDC provider matches the configured
OIDC_REDIRECT_ADDRESSand provider name. -
Email not matching: Check that the
emailscope is requested and the user’s email matches theOIDC_EMAIL_MATCHESpatterns. -
PKCE issues: If your OIDC provider doesn’t support PKCE, set
OIDC_USE_PKCE=false. - HTTPS required: Some providers require HTTPS for the redirect URI. Ensure your Warnly instance is accessible over HTTPS.
Debugging
- Check the Warnly logs for OIDC-related errors
- Verify the OIDC issuer URL is accessible and returns valid OIDC configuration
- Ensure the client ID and secret are correct
- Test the OIDC flow manually using tools like OIDC Debugger