Skip to content

Single sign-on (OIDC)

curral accepts JWTs from any OIDC provider sent as Authorization: Bearer <JWT>. Over Flight SQL the token goes in the same gRPC header, on every call; JDBC clients set it as the token driver property.

Terminal window
curral serve ... \
--oidc-issuer https://sso.example.com/realms/main \
--oidc-audience curral \
--oidc-user-claim preferred_username \
--oidc-roles-claim realm_access.roles
  • Startup: curral runs OIDC discovery and downloads the JWKS. If the provider is unreachable, startup fails. Keys refresh in the background.
  • Validation: signature, iss, aud, exp and nbf, with --oidc-skew (30 s) of clock tolerance. Unsigned tokens (alg: none) and tokens signed by another key are rejected.
  • Audience is mandatory.
  • Claims: dotted paths work (realm_access.roles). The roles claim may be a list or a space-separated string such as scope.

Some providers, such as Google, send no roles. The identities section of the users file assigns roles per user or per e-mail domain. It also gives roles to the subjects a delegating service names:

identities:
- match: ana@example.com # exact, case-insensitive
roles: [analyst]
- match: "*@example.com" # any address in the domain (not subdomains)
roles: [analyst]

Mapped roles are added to the roles in the token. A user who matches nothing has no roles, and gets nothing under a deny-by-default policy.

Terminal window
curral serve ... \
--oidc-issuer https://accounts.google.com \
--oidc-audience <CLIENT_ID>.apps.googleusercontent.com \
--oidc-user-claim email
# Google Workspace only: --oidc-hosted-domain example.com
  • Create an OAuth client in Google Cloud Console → APIs & Services → Credentials.
  • Clients send the ID token. Google access tokens are not JWTs and do not work.
  • With an “External” consent screen, any Google account can get a valid token for your client ID. Access comes only from identities, and email_verified is required (--oidc-require-email-verified).
Flag Default
--oidc-issuer off issuer URL
--oidc-audience required aud
--oidc-user-claim sub claim used as the user name
--oidc-roles-claim roles claim with roles
--oidc-skew 30s clock tolerance
--oidc-require-email-verified true with email as user claim
--oidc-hosted-domain any accepted hd claims, repeatable

To accept JWTs from more than one identity provider at the same time (for example, Google Workspace for users and GitHub Actions or Kubernetes ServiceAccounts for pipelines), pass --oidc-providers providers.yaml instead of --oidc-issuer:

providers:
- issuer: https://accounts.google.com
audience: <CLIENT_ID>.apps.googleusercontent.com
user_claim: email
require_email_verified: true
hosted_domains: [example.com]
- issuer: https://token.actions.githubusercontent.com
audience: curral
user_claim: sub
roles_claim: job_workflow_ref
role_prefix: "gh:"

Each incoming JWT is dispatched strictly by its iss claim to the matching provider and cryptographically verified only against that provider’s JWKS, iss, aud, exp, and nbf. Unknown issuers are rejected immediately, and role_prefix isolates role namespaces between providers.