Generic OIDC Setup
This guide covers configuring AgentCube with any OIDC-compliant identity provider — Okta, Auth0, Keycloak, or others. You register one application whose redirect URI points at the Context Engine, the single endpoint the AI platform authenticates against.
Prerequisites
Section titled “Prerequisites”- An OIDC-compliant identity provider with admin access
- The provider must support the Authorization Code flow
- The provider must issue access tokens as JWTs that include
emailorpreferred_username
Step 1: Create an Application
Section titled “Step 1: Create an Application”In your identity provider’s admin console:
- Create a new application (Web application type)
- Set the redirect URI / callback URL to the Context Engine’s callback URL:
https://{ce_hostname}/auth/callback
- Enable the Authorization Code grant type
- Configure the application to include
emailorpreferred_usernamein access token claims (not only the ID token)
Step 2: Note Discovery URL
Section titled “Step 2: Note Discovery URL”Locate your provider’s OpenID Connect discovery endpoint. This is typically:
https://{idp_hostname}/.well-known/openid-configurationProvider-specific examples:
| Provider | Discovery URL Pattern |
|---|---|
| Okta | https://{okta_domain}/oauth2/default/.well-known/openid-configuration |
| Auth0 | https://{auth0_domain}/.well-known/openid-configuration |
| Keycloak | https://{keycloak_host}/realms/{realm}/.well-known/openid-configuration |
Step 3: Record Configuration Values
Section titled “Step 3: Record Configuration Values”Set these on the Context Engine, with AGENTCUBE_CE_AUTH_MODE=oidc and AGENTCUBE_CE_OIDC_PROVIDER=oidc:
| IdP Value | Environment Variable |
|---|---|
| Discovery URL | AGENTCUBE_CE_OIDC_CONFIG_URL |
| Client ID | AGENTCUBE_CE_OIDC_CLIENT_ID |
| Client secret | AGENTCUBE_CE_OIDC_CLIENT_SECRET |
Context Engine public URL (for example https://{ce_hostname}) | AGENTCUBE_CE_OIDC_BASE_URL |
The base URL must use the same host as the redirect URI you registered in Step 1. The default AGENTCUBE_CE_AUTH_MODE is basic, under which the Context Engine refuses to start if any AGENTCUBE_CE_OIDC_* variable is set. To require sign-in, see Single Sign-On.
Optional:
| IdP Value | Environment Variable | Default |
|---|---|---|
| Scopes | AGENTCUBE_CE_OIDC_SCOPES | openid,profile,email |
| Audience | AGENTCUBE_CE_OIDC_AUDIENCE | the client ID |
Step 4: Verify Token Claims
Section titled “Step 4: Verify Token Claims”The Context Engine reads identity from the access token, which must be a JWT it can verify against your provider’s published signing keys. Ensure your identity provider returns at least one of these claims in the access token:
email— most common for Okta, Auth0preferred_username— common for Keycloakupnsub— universal fallback
Some providers leave email out of access tokens by default. In Okta, add an email claim to the authorization server’s access token; in Auth0, add it to the access token with an Action. If the claim appears only in the ID token, the user is identified by sub and the Oracle username match fails.
The claim value must match the username in your OCI Identity Domain (see OCI Identity Domain Setup).
Access tokens must carry an aud claim equal to the client ID, or to AGENTCUBE_CE_OIDC_AUDIENCE when your provider issues tokens for a separate API identifier; a token issued for any other application is rejected. If a token carries email_verified with any value other than true, the Context Engine ignores the email-shaped claims and identifies the user by sub.
Give each connector its own token audience
Section titled “Give each connector its own token audience”The Context Engine signs a token for every call it makes to a connector in internal mode. Give each connector its own audience, set the same value as that connector’s AGENTCUBE_INTERNAL_AUDIENCE, and a token made for one connector is refused by the others. A connector with no audience of its own receives tokens with the audience shared by every internal connector, and the Context Engine flags it as shared. The steps, including how to move a running connector without downtime, are in Upgrades.
Next Steps
Section titled “Next Steps”- Set up OCI Identity Domain for Oracle token exchange
- Generate the signing key
- Configure environment variables