Outcome: Workloads can call Formal APIs with IdP JWTs and mint connector access tokens.
Prerequisites: A Formal machine user, and an IdP that can mint OIDC JWTs.
Overview
OIDC integrations let external workloads authenticate to the Formal with short-lived identity-provider JWTs. Formal verifies the token, evaluates a claim condition, and maps the caller to a configured machine user. The same trust can mint a short-lived federation token. Use that credential to access data through a Formal — without long-lived Formal API keys or machine access tokens. Use this for remote workloads such as GitHub Actions, GitLab, or Terraform Cloud.OIDC integrations are separate from SSO. SSO
covers human console login. OIDC integrations cover machine authentication to
core APIs and optional federated connector access.
How It Works
- You create an OIDC integration with an issuer, machine user, and claim condition.
- Formal returns an audience value:
oidc.formal.ai/<integration_id>. - Your identity provider issues a JWT with that exact
audclaim. - The caller presents the JWT as a Bearer token to Formal core APIs.
- Formal verifies signature, issuer, audience, time claims, and the claim condition.
- The request runs as the integration’s machine user.
- Optionally, the caller mints a federation token and connects through a Connector.
Setup in the Formal Console
- Go to OIDC Integrations.
- Click Create Integration.
- Fill in:
- Name — unique friendly name in your org
- Issuer — absolute HTTPS issuer URL
- JWKS URI — optional; leave empty to use OIDC Discovery
- Machine User — Formal principal that authenticated tokens map to
- Claim Condition — CEL expression over
claims(defaulttrue) - End-User Email Expression — optional CEL that returns an email string
- Status —
activeordraft(draft disables auth)
- Copy the Audience value shown after create.
- Configure your identity provider to mint tokens with that audience.
oidc.formal.ai/integrationoidc_….
Claim Conditions
Claim conditions are CEL expressions that must return a boolean. Verified JWT claims are available underclaims.
Examples:
Federated Connector Access
After an OIDC JWT authenticates to the control plane, callCreateFederationToken to mint a short-lived connector credential.
Only OIDC-authenticated machine users can call this RPC. API keys and human
sessions cannot mint federation tokens.
Mint a federation token
Connect through a Connector
Use the response like any Formal username and access token:<USERNAME> and <FEDERATION_TOKEN> with username and token from
the mint response.
Protocols that present the Formal JWT can authenticate immediately. Protocols
that match stored credentials (for example some MySQL and S3 paths) need the
token to sync to the Connector first. Retry briefly if auth fails right after
mint.
Token lifetime and claims
Federation token expiry is:
Upstream OIDC claims are not copied into the federated JWT or synced to
Connectors.
End-user attribution
Set End-User Email Expression when the workload acts for a human. The CEL expression runs over verified IdP claims and must return an email string. At mint time, Formal resolves that email to a Formal human user (case-insensitive). Sessions then use the machine user for credentials and the human user as the for policy and audit. Examples:Permissions and Audit
Verified OIDC callers expose claim context to Permissions as:input.user.oidc.integration_idinput.user.oidc.issuerinput.user.oidc.claims.*
Terraform
You can manage the same resource with Terraform:Troubleshooting
Discovery or JWKS fails
Discovery or JWKS fails
Possible causes:
- Issuer is not HTTPS
- Discovery endpoint is unreachable from Formal
- JWKS URI is missing when discovery is unavailable
CreateFederationToken returns failed precondition
CreateFederationToken returns failed precondition
Possible causes:
- Caller used an API key instead of an OIDC Bearer JWT
- Caller is not a machine user
- Upstream OIDC JWT is expired
- End-user email expression failed or matched no Formal human
Connector rejects the federation token
Connector rejects the federation token
Possible causes:
- Token expired (
min(OIDC exp, 1 hour)) - Wrong Formal username (must be the mint response
username) - Credential-match protocol used before the token synced
Next Steps
Permissions
Authorize federated callers with claim-aware rules
Machine Users
Create the machine principal OIDC tokens map to
Connectors
Deploy Connectors that accept federation tokens
SSO
Configure human console login separately