Skip to main content

Authentication

Enterprise validates inbound JWTs against your OIDC provider on every request. There is no user database lookup - identity, the sign-in role, groups, and project memberships all come from the token claims you configure.

If you're an end user looking to obtain a token to call the API, see the general Authentication page. This page is for operators wiring up the IdP.

Stateless model​

The backend reads these OIDC-related environment variables:

VariableRequiredDefaultPurpose
OIDC_ISSUERYes-Issuer URL, exactly as the issuer value in the provider's discovery document, trailing slash included. The backend fetches {issuer}/.well-known/openid-configuration at startup and uses the published JWKS to verify token signatures.
OIDC_CLIENT_IDYes-Client ID the console signs in with. Accepted as a valid aud claim.
OIDC_AUDIENCESNo-Extra accepted aud values beyond OIDC_CLIENT_ID. Comma-separated, without spaces.
OIDC_ROLES_CLAIMNorolesPath to the global roles claim, a JSON array of strings. Dot-notation supported (e.g., realm_access.roles).
OIDC_PROJECTS_CLAIMNoprojectsPath to the per-project memberships claim.
OIDC_USER_CLAIMNosubPath to the claim that identifies the caller, such as email or preferred_username. A token without it, or with an empty value, falls back to sub.
OIDC_SCOPESNoopenid profile email offline_accessSpace-separated scopes the console requests at sign-in. Add your API scope when the IdP issues an access token for the API only on that scope, such as api://<app-id>/access on Azure AD.
OIDC_RESPONSE_TYPENocodeOAuth response type the console requests at sign-in.

The same settings go in the config file's oidc block as issuer, clientID, audiences, rolesClaim, projectsClaim, userClaim, scopes and responseType. The Helm chart sets them from config.oidc.

What the platform reads from a token​

Token verification checks:

  • Signature - RS, PS or ES (256, 384, 512) or EdDSA, against the JWKS published at the discovery endpoint.
  • Issuer - must equal OIDC_ISSUER.
  • Audience - must contain OIDC_CLIENT_ID or one of OIDC_AUDIENCES.
  • Expiry - standard exp check.

The console and API clients send an access token as the bearer token, and the backend reads these claims from it:

ClaimPurpose
OIDC_USER_CLAIM (default sub)User identifier. It is the user recorded on deploys, starts and completions, and the one user-task assignees and candidate users are matched against.
OIDC_ROLES_CLAIM (default roles)Dual purpose - see Roles, groups, and user tasks. Must contain user to sign in, and drives BPMN user-task candidate-group matching.
OIDC_PROJECTS_CLAIM (default projects)Per-project memberships. Shape below.

Project membership shape​

The projects claim must carry one entry per project the caller has access to:

{
"projects": [
{ "id": "00000000-0000-0000-0000-000000000001", "roles": ["editor"] },
{ "id": "00000000-0000-0000-0000-000000000002", "roles": ["viewer"] }
]
}

Each entry needs:

  • id - the project UUID in lowercase, as GET /projects returns it, matching the id from your provisioning YAML.
  • roles - array of project-level roles (admin, editor, executor, viewer).

Two projects in the claim must not share the same id.

The platform also accepts the claim as a JSON-encoded string for providers that don't ship structured claims natively.

Wildcard (*) - all-projects grant​

A project entry with id set to "*" grants its roles on every project, present and future. This is intended for a platform-operations team that administers the whole BPMN stack:

{
"projects": [
{ "id": "*", "roles": ["admin"] }
]
}

The wildcard's own roles array is honored - "*" with ["admin"] grants admin everywhere, ["viewer"] grants read-only everywhere. An explicit per-project entry takes effect when it grants a higher role than the wildcard (e.g. a ["viewer"] wildcard plus an ["admin"] entry for one project = admin on that project, viewer elsewhere).

Security note: a "*" entry is a broad grant. Restrict who your IdP maps it to - anyone whose token carries {"id":"*","roles":["admin"]} becomes an administrator of every project.

Claim-path dot notation​

OIDC_ROLES_CLAIM and OIDC_PROJECTS_CLAIM accept dot-notated paths to nested claims. For example, Keycloak ships realm roles under realm_access.roles:

{
"realm_access": {
"roles": ["user", "approvers"]
}
}

Setting OIDC_ROLES_CLAIM=realm_access.roles makes the platform traverse that path. A claim named exactly as the path, such as https://example.com/roles, is read as it is. Otherwise each dot in a path steps into a nested object. OIDC_USER_CLAIM takes the same paths.

Wiring up a provider​

The platform works with any OIDC-compliant IdP as long as you can shape the tokens it issues to match the contract above.

For any provider, you need to:

  1. Register a public client for the console, using the authorization code flow with PKCE. Its redirect URI is https://<console-host>/auth/callback. Sign-out returns to the console's origin, or to POST_LOGOUT_REDIRECT when the console container sets it. Put the client ID in OIDC_CLIENT_ID.
  2. Configure a claim named per OIDC_ROLES_CLAIM containing user for everyone allowed to use the platform, plus their groups, or accept the default roles path.
  3. Configure a claim named per OIDC_PROJECTS_CLAIM containing the per-project memberships in the shape above. Most providers expose this through a custom claim mapper - consult their documentation.
  4. Set OIDC_ISSUER and OIDC_CLIENT_ID on the backend.
  5. If the IdP issues API access tokens on a scope of their own, add that scope to OIDC_SCOPES and the token's aud to OIDC_AUDIENCES. Otherwise the console signs in but the backend rejects its token.

Keycloak example​

Keycloak is the worked example. The Helm chart's values-example.yaml uses the same setup.

# Backend environment
OIDC_ISSUER=https://keycloak.example.com/realms/quantumbpm
OIDC_CLIENT_ID=quantumbpm-enterprise
OIDC_ROLES_CLAIM=realm_access.roles
OIDC_PROJECTS_CLAIM=projects

Create quantumbpm-enterprise as a public OpenID Connect client with the standard flow and the console's redirect URI. In its dedicated client scope:

  • Add an Audience mapper that includes quantumbpm-enterprise in the access token's aud.
  • Add a custom claim mapper that populates the projects claim in the documented shape, with Add to access token on.

Realm roles end up under realm_access.roles in the access token automatically.

Other providers​

For Okta, Auth0, Azure AD, Zitadel, and others, the same contract applies. The specifics - which UI screens, where the claim mapper lives, whether it's "groups" or "roles" by default - vary by provider, consult their documentation, then point OIDC_ROLES_CLAIM and OIDC_PROJECTS_CLAIM at the right paths. If you hit a wall, contact support@quantumbpm.com.

Mock OIDC for local testing​

The repo bundles a small mock OIDC provider (tools/mockoidc) that issues tokens in the shape the platform expects. It is a local/CI testing tool only - it hands out a one-click token that is admin on every project and must never be exposed in a real deployment. Run it locally with make run-mock-oidc (or it is built on demand by the kind test harness). In production, point OIDC_ISSUER at your real IdP.

Roles, groups, and user tasks​

There is no separate "groups" claim. The single array at OIDC_ROLES_CLAIM does double duty:

  1. Signing in - the entry user lets the caller use the platform at all (see the role model).
  2. BPMN user-task candidate-group matching - every entry in that array is matched as an identity-provider group name. When a BPMN user task carries candidateGroups, the platform authorizes a caller to complete or fail it if any entry of their roles claim matches any of the task's candidate groups (alongside the assignee and candidate-user checks).

This means your roles claim is user plus the group names this user has. Mix them freely:

{
"roles": ["user", "approvers", "finance", "ops-oncall"]
}

In that token:

  • user lets the caller sign in.
  • approvers, finance, ops-oncall are treated as identity-provider groups. A user task with candidateGroups: ["approvers"] accepts this caller when the projects claim grants them a role on the project, viewer included.

You don't have to declare which entries are groups. The sign-in check looks for user, and user-task authorization compares every entry of the caller's roles array with the task's candidate-group list, as exact, case-sensitive strings.

The role model​

What a caller may do in a project comes from the projects claim alone, with a strict hierarchy:

admin  ⊃  editor  ⊃  executor  ⊃  viewer

See Authentication → The role model for the full table.

A project the claim grants no role on returns 404 Not Found, the same as a project that doesn't exist, to avoid confirming which project IDs exist. A role too low for an endpoint returns 403 Forbidden. If you're getting unexpected 404s, the most common cause is a missing or wrong-cased project entry in the user's projects claim.

The backend logs a rejected token at WARN as Token verification failed with the reason, such as the token's audience and the accepted ones. A claim it cannot read is logged at WARN as failed to extract roles from claim or failed to extract projects from claim, with the claim path.