Skip to content

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.

  • 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 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:

  1. In the OCI Identity Domain, go to the Federation tab

  2. Click + Add Identity Provider → Add SAML IdP

  3. Name: A descriptive name for this federation (e.g., Corporate SSO)

  4. Upload the Entra Federation Metadata XML

    • Download from: Entra → Enterprise Applications → your app → Single sign-on → Federation Metadata XML link
  5. Configure user mapping under the IdP’s User mapping section:

    SettingValue
    Requested Name ID formatEmail address
    Identity provider user attributeSAML 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.

  6. Activate the IdP

  7. Test by navigating to the Oracle application login page and selecting the federated IdP option

If your Entra app registrations have Assignment required set to Yes, each user must be explicitly assigned to both applications:

  1. AgentCube MCP app: Enterprise Applications → AgentCube MCP → Users and groups → Add user/group
  2. OCI Identity Domain app (if SAML federation is configured): Enterprise Applications → OCI Identity Domain → Users and groups → Add the same users/groups

Use this checklist for each new SSO deployment:

See Microsoft Entra ID setup.

  • 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 2 in the manifest
  • Admin consent granted for the organization
  • User assignments completed (if assignment-required is enabled)

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 inbound auth set: AGENTCUBE_CE_AUTH_MODE=oidc with the AGENTCUBE_CE_OIDC_* values
  • Context Engine /health confirms auth_mode: oidc
  • Context Engine has AGENTCUBE_CE_INTERNAL_SIGNING_KEY set (PEM RSA private key). The Context Engine will not start if a connector is registered with auth mode internal and this key is missing.
  • Each user-lane connector runs with AGENTCUBE_CONNECTOR_MODE=user and AGENTCUBE_AUTH_MODE=internal, with AGENTCUBE_INTERNAL_ISSUER (exactly the Context Engine’s AGENTCUBE_CE_OIDC_BASE_URL), AGENTCUBE_INTERNAL_AUDIENCE={connector_url} and AGENTCUBE_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/token suffix), OCI_CLIENT_ID, OCI_CLIENT_SECRET, AGENTCUBE_SIGNING_KEY_PATH or AGENTCUBE_SIGNING_KEY_BASE64, AGENTCUBE_SIGNING_KID matching 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’s AGENTCUBE_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.

  • 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
ErrorCauseFix
AADSTS9010010: resource parameter doesn’t match scopesApplication ID URI is not api://{client_id}, the access scope is missing under Expose an API, or the token version is not 2Reset 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 secretUsing the Secret ID instead of the Secret Value, or secret has expiredCopy the Value (not ID); generate new if expired
OCI: Certificate does not exist in key storeSigning certificate not imported, or alias mismatchImport .cer to Trusted partner certificates; verify alias matches AGENTCUBE_SIGNING_KID
OCI: invalid_grant — user name invalidJWT subject does not match any OCI usernameCreate user in OCI with username matching the email/UPN from Entra
Planning or FCCS REST returns 401 after a successful token exchangeOCI_RESOURCE_SCOPE unset, so the connector requests a wildcard token that the EPM service rejectsSet OCI_RESOURCE_SCOPE on the Planning or FCCS connector per OCI Identity Domain setup
OCI: invalid_client — client auth failedOCI confidential app credentials incorrectVerify OCI_CLIENT_ID and OCI_CLIENT_SECRET
User blocked: not a member of a group with accessEnterprise app assignment required but user not assignedAdd user to both AgentCube MCP and OCI Identity Domain enterprise apps in Entra