configuredIdp). The AI Gateway uses the OAuth 2.0 client credentials flow against your IdP.
How it works
- IdP token: The AI Gateway sends a
client_credentialsrequest to your IdP’s token endpoint. The IdP returns a signed JWT for the AI Gateway client app. - Provider exchange: The AI Gateway exchanges that JWT with the provider:
The provider verifies the JWT signature with your IdP’s public keys. It checks
iss, aud, and sub against your configured rules, then issues a short-lived access token for a service account.
The AI Gateway caches both tokens and refreshes them before they expire. Provider tokens are cached for no more than 15 minutes. Rotating the client secret invalidates the cache.
Setup overview
Start with the IdP. The provider side needs the exact
iss, aud, and sub values from a real token.
Step 1: Configure the identity provider
- Microsoft Entra ID
- Okta
- Other OIDC IdPs
1. Register an API app (the audience)
- Go to Entra admin center → App registrations → New registration. Name it
aigw-wif-api. - Open Expose an API and set the Application ID URI, for example
api://<api-app-client-id>. - Open Manifest and set
requestedAccessTokenVersionto2. In the legacy manifest, setaccessTokenAcceptedVersionto2. This makes Entra issue v2 tokens with a stable issuer.
- Create another registration named
aigw-wif-client. - Go to Certificates & secrets → New client secret. Copy the secret value.
- Optional but recommended: add an app role to
aigw-wif-apiwith Allowed member types: Applications. Grant it toaigw-wif-clientunder API permissions → Application permissions, then grant admin consent.
The resulting token contains:
Entra access tokens last 60–90 minutes. For Anthropic, set the issuer’s maximum JWT lifetime to at least
5400 seconds. See Step 2.Verify the token
Request a token manually and decode it locally before configuring the provider. Don’t paste production tokens into third-party JWT sites.jq filter converts it to padded Base64 before decoding.
Copy iss, aud, and sub. The provider configuration must match them exactly.
Step 2: Configure the provider
- OpenAI
- Anthropic
Requires permission to manage Workload Identity Providers in the OpenAI organisation.1. Create a Workload Identity ProviderGo to Organization Settings → Security → Workload Identity Provider and create an OIDC provider:
Leave custom discovery and uploaded JWKS off. OpenAI fetches keys from the issuer’s discovery document.2. Add a service account mappingFrom the provider details page, add a mapping:
Use exact values instead of wildcards. If more than one enabled mapping matches, OpenAI rejects the exchange.3. Copy the IDs
- Identity Provider ID: from the Workload Identity Provider
- Service Account ID: from the mapped service account
Step 3: Create the integration in the AI Gateway
- In Strata Cloud Manager, go to Model Catalog → Add Provider. Select OpenAI or Anthropic.
- Select Workload Identity Federation as the authentication type.
- Enter the IdP values from Step 1:
- Enter the provider values from Step 2:
- Save, then create a provider, for example
@openai-wif.
Create via Admin API
Useprovider_auth_type: "wif" in configurations when calling Create Integration. Don’t send key. WIF integrations don’t use a provider API key.
Troubleshooting
The AI Gateway returns only the standard OAuth error code, such asinvalid_client. The full IdP or provider response stays in gateway logs and never goes back to the caller.
Security recommendations
- Use a dedicated IdP client app and provider service account for each AI Gateway integration and environment.
- Match
subexactly. Avoid wildcard or prefix matches. - Restrict provider permissions: use mapping Permissions in OpenAI and
workspace:inferencein Anthropic. - Store the client secret in a secret manager and rotate it regularly.
- To revoke access immediately, disable the OpenAI mapping or Anthropic rule. Cached tokens expire within 15 minutes.

