Skip to content

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.

  • 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 email or preferred_username

In your identity provider’s admin console:

  1. Create a new application (Web application type)
  2. Set the redirect URI / callback URL to the Context Engine’s callback URL:
    https://{ce_hostname}/auth/callback
  3. Enable the Authorization Code grant type
  4. Configure the application to include email or preferred_username in access token claims (not only the ID token)

Locate your provider’s OpenID Connect discovery endpoint. This is typically:

https://{idp_hostname}/.well-known/openid-configuration

Provider-specific examples:

ProviderDiscovery URL Pattern
Oktahttps://{okta_domain}/oauth2/default/.well-known/openid-configuration
Auth0https://{auth0_domain}/.well-known/openid-configuration
Keycloakhttps://{keycloak_host}/realms/{realm}/.well-known/openid-configuration

Set these on the Context Engine, with AGENTCUBE_CE_AUTH_MODE=oidc and AGENTCUBE_CE_OIDC_PROVIDER=oidc:

IdP ValueEnvironment Variable
Discovery URLAGENTCUBE_CE_OIDC_CONFIG_URL
Client IDAGENTCUBE_CE_OIDC_CLIENT_ID
Client secretAGENTCUBE_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 ValueEnvironment VariableDefault
ScopesAGENTCUBE_CE_OIDC_SCOPESopenid,profile,email
AudienceAGENTCUBE_CE_OIDC_AUDIENCEthe client ID

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:

  1. email — most common for Okta, Auth0
  2. preferred_username — common for Keycloak
  3. upn
  4. sub — 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.