Entra ID to OCI Federation
This guide covers establishing federated SSO between Microsoft Entra ID and an OCI Identity Domain for AgentCube SSO deployments. This is required when your users authenticate via Entra and your data sources are hosted on Oracle Cloud Infrastructure. Inbound authentication (Layer 1) is handled by the Context Engine; the Oracle token exchange (Layer 2) runs in each connector.
This page summarizes the end-to-end setup as a checklist. The detailed steps are in Microsoft Entra ID setup, OCI Identity Domain setup and Signing key setup.
Prerequisites
Section titled “Prerequisites”- Entra ID: Global Administrator or Application Administrator role
- OCI: Identity Domain Administrator privileges
- AgentCube: Context Engine deployed with a public HTTPS URL; connectors deployed and reachable from the Context Engine
- OpenSSL: Installed locally for certificate generation
SAML Federation (Optional)
Section titled “SAML Federation (Optional)”SAML federation enables browser-based SSO login to Oracle applications (Essbase Web UI, Planning and FCCS Web UI) using Entra credentials. This is separate from the JWT assertion flow used by AgentCube and is optional.
If your organization also wants browser-based Oracle login via Entra:
Configure Entra as a SAML IdP in OCI
Section titled “Configure Entra as a SAML IdP in OCI”-
In the OCI Identity Domain, go to the Federation tab
-
Click + Add Identity Provider → Add SAML IdP
-
Name: A descriptive name for this federation (e.g.,
Corporate SSO) -
Upload the Entra Federation Metadata XML
- Download from: Entra → Enterprise Applications → your app → Single sign-on → Federation Metadata XML link
-
Configure user mapping under the IdP’s User mapping section:
Setting Value Requested Name ID format Email address Identity provider user attribute SAML assertion Name ID Maps to (Identity domain user attribute) Username This ensures Entra sends the user’s email as the Name ID, and OCI maps it to the username field.
-
Activate the IdP
-
Test by navigating to the Oracle application login page and selecting the federated IdP option
Enterprise App Assignments
Section titled “Enterprise App Assignments”If your Entra app registrations have Assignment required set to Yes, each user must be explicitly assigned to both applications:
- AgentCube MCP app: Enterprise Applications → AgentCube MCP → Users and groups → Add user/group
- OCI Identity Domain app (if SAML federation is configured): Enterprise Applications → OCI Identity Domain → Users and groups → Add the same users/groups
Deployment Checklist
Section titled “Deployment Checklist”Use this checklist for each new SSO deployment:
Entra ID
Section titled “Entra ID”- App registration created with single-tenant access
- Client secret generated and stored securely
- Redirect URI added for the Context Engine (
https://{ce_hostname}/auth/callback) - Application ID URI left at the default
api://{client_id}(Expose an API) - Custom scope (
access) created under Expose an API - Token version set to
2in the manifest - Admin consent granted for the organization
- User assignments completed (if assignment-required is enabled)
OCI Identity Domain
Section titled “OCI Identity Domain”See OCI Identity Domain setup and Signing key setup.
- Confidential application created with JWT Assertion and Client Credentials grant types
- Identity Domain Administrator app role assigned to the confidential app
- Application activated
- AgentCube signing certificate imported with known alias
- Users provisioned with usernames matching Entra email/UPN
- Users assigned to appropriate groups for application access
Context Engine + connectors
Section titled “Context Engine + connectors”- Context Engine inbound auth set:
AGENTCUBE_CE_AUTH_MODE=oidcwith theAGENTCUBE_CE_OIDC_*values - Context Engine
/healthconfirmsauth_mode: oidc - Context Engine has
AGENTCUBE_CE_INTERNAL_SIGNING_KEYset (PEM RSA private key). The Context Engine will not start if a connector is registered with auth modeinternaland this key is missing. - Each user-lane connector runs with
AGENTCUBE_CONNECTOR_MODE=userandAGENTCUBE_AUTH_MODE=internal, withAGENTCUBE_INTERNAL_ISSUER(exactly the Context Engine’sAGENTCUBE_CE_OIDC_BASE_URL),AGENTCUBE_INTERNAL_AUDIENCE={connector_url}andAGENTCUBE_INTERNAL_JWKS_URL(https://{ce_hostname}/.well-known/jwks.json) - Each user-lane connector has the Oracle token exchange settings:
OCI_TOKEN_ENDPOINT(the identity domain base URL, without the/oauth2/v1/tokensuffix),OCI_CLIENT_ID,OCI_CLIENT_SECRET,AGENTCUBE_SIGNING_KEY_PATHorAGENTCUBE_SIGNING_KEY_BASE64,AGENTCUBE_SIGNING_KIDmatching the certificate alias, and, for Planning and FCCS connectors,OCI_RESOURCE_SCOPE=urn:opc:serviceInstanceID={service_instance_id}urn:opc:resource:consumer::all(leave it unset for Essbase; see OCI Identity Domain setup) - Each user-lane connector registered in the Context Engine with auth mode
internal - Each user-lane connector has its own audience set in the Context Engine (the connector’s page in the admin portal, or
PUT /api/v1/admin/connectors/{connector_id}/internal-audience), equal to that connector’sAGENTCUBE_INTERNAL_AUDIENCE. Without one, every internal connector shares one audience and the Context Engine flags each of them as shared. - Context Engine and connectors deployed and accessible
For the full variable reference, see Environment variables and Auth modes.
Validation
Section titled “Validation”- Admin user can connect, complete Entra login, and execute tool calls
- Tool calls return data scoped to the authenticated user’s security profile
- A second user with different permissions sees different data through the same Context Engine endpoint
Common Errors
Section titled “Common Errors”| Error | Cause | Fix |
|---|---|---|
AADSTS9010010: resource parameter doesn’t match scopes | Application ID URI is not api://{client_id}, the access scope is missing under Expose an API, or the token version is not 2 | Reset the Application ID URI to api://{client_id}, confirm the access scope exists, and set the token version to 2 in the manifest |
AADSTS7000215: Invalid client secret | Using the Secret ID instead of the Secret Value, or secret has expired | Copy the Value (not ID); generate new if expired |
| OCI: Certificate does not exist in key store | Signing certificate not imported, or alias mismatch | Import .cer to Trusted partner certificates; verify alias matches AGENTCUBE_SIGNING_KID |
OCI: invalid_grant — user name invalid | JWT subject does not match any OCI username | Create user in OCI with username matching the email/UPN from Entra |
Planning or FCCS REST returns 401 after a successful token exchange | OCI_RESOURCE_SCOPE unset, so the connector requests a wildcard token that the EPM service rejects | Set OCI_RESOURCE_SCOPE on the Planning or FCCS connector per OCI Identity Domain setup |
OCI: invalid_client — client auth failed | OCI confidential app credentials incorrect | Verify OCI_CLIENT_ID and OCI_CLIENT_SECRET |
| User blocked: not a member of a group with access | Enterprise app assignment required but user not assigned | Add user to both AgentCube MCP and OCI Identity Domain enterprise apps in Entra |