Documentation Index
Fetch the complete documentation index at: https://kaneo.app/docs/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Kaneo supports custom OAuth 2.0 and OpenID Connect (OIDC) providers, allowing you to integrate with any standards-compliant identity provider such as Keycloak, Auth0, Okta, Azure AD, or self-hosted solutions like Pocket ID.Configuration
To configure a custom OAuth/OIDC provider, you need to set the following environment variables in your.env file:
Required Variables
| Variable | Description | Example |
|---|---|---|
CUSTOM_OAUTH_CLIENT_ID | OAuth client ID from your provider | 2b1ae9df-8d25-4dbc-8cc8-f8f2c1ef6bd0 |
CUSTOM_OAUTH_CLIENT_SECRET | OAuth client secret from your provider | NzDjplDsdQyP062wTmkZ8kyiaziBag0N |
CUSTOM_OAUTH_AUTHORIZATION_URL | Authorization endpoint URL | https://id.example.com/authorize |
CUSTOM_OAUTH_TOKEN_URL | Token exchange endpoint URL | https://id.example.com/api/oidc/token |
CUSTOM_OAUTH_USER_INFO_URL | User info endpoint URL | https://id.example.com/api/oidc/userinfo |
Optional Variables
| Variable | Description | Default |
|---|---|---|
CUSTOM_OAUTH_DISCOVERY_URL | OpenID Connect discovery document URL | - |
CUSTOM_OAUTH_SCOPES | Comma-separated list of OAuth scopes | profile,email |
CUSTOM_OAUTH_RESPONSE_TYPE | OAuth response type | code |
CUSTOM_AUTH_PKCE | Enable/disable PKCE (Proof Key for Code Exchange) | true |
CUSTOM_OAUTH_LOGOUT_URL | Logout endpoint URL (optional) | https://id.example.com/api/oidc/logout |
Setup Steps
1. Configure Your OAuth Provider
First, create an OAuth 2.0 or OIDC application in your identity provider:- Log in to your identity provider’s admin console
- Create a new OAuth 2.0 or OIDC application
- Set the redirect URI to:
{KANEO_API_URL}/api/auth/oauth2/callback/custom- Example:
https://api.kaneo.example.com/api/auth/oauth2/callback/custom
- Example:
- Copy the client ID and client secret
- Note the authorization, token, and userinfo endpoint URLs
2. Set Environment Variables
Add the following to your.env file:
3. Restart Services
After updating the environment variables, restart your Kaneo services:Example Configurations
Pocket ID
Keycloak
Auth0
Usage
Once configured, users will see a “Continue with OIDC” button on the sign-in page. The system will automatically remember the last used login method for each user.Troubleshooting
”Invalid code verifier” Error
This error typically indicates a PKCE configuration issue. Try setting:Missing User Information
Ensure your OAuth scopes include at leastprofile and email:
openid scope as well:
Redirect URI Mismatch
Verify that your redirect URI in the OAuth provider matches exactly:KANEO_API_URL=https://api.kaneo.example.com, the redirect URI should be:
Discovery URL
If your provider supports OpenID Connect, you can use the discovery URL to automatically configure most settings:Security Notes
- Always use HTTPS in production
- Keep your client secret secure and never commit it to version control
- Enable PKCE when possible for enhanced security
- Use the most restrictive scopes necessary for your use case