Skip to main content

Authentication

Every QuantumBPM API endpoint except /config, /version, /healthz and /readyz requires a bearer token in the Authorization header. The platform doesn't ship its own identity store - tokens are issued by an OpenID Connect (OIDC) provider, and the backend validates them on every request.

This page is the integrator's reference: how to get a token, how to use it, and what role/permission model is applied to your calls.

How auth works​

┌──────────────┐   client credentials    ┌─────────────────┐
│ Client │ ──────────────────────► │ OIDC provider │
│ (worker / │ │ (your IdP) │
│ SDK / app) │ ◄────── access token ── │ │
└──────────────┘ └─────────────────┘
│
│ Authorization: Bearer <token>
▼
┌──────────────────────────────────────┐
│ Platform API │
│ • Validates the token's signature │
│ • Reads identity, roles, projects │
│ from token claims │
│ • Applies project RBAC │
└──────────────────────────────────────┘

The token's claims tell the platform who the caller is, which projects they can access, and at what role. The backend never makes its own decision about permissions - it trusts what your IdP signs.

Tokens​

The platform validates tokens from any standards-compliant OIDC provider. Ask your operator for the issuer URL, the token endpoint, and a client ID and secret, or for instructions on getting a personal token.

Use caseHow to obtain
Interactive userSign in to the Platform Console. The SPA handles the OIDC flow for you. Its token works for direct API calls, though it's tied to a browser session and expires
Service account (workers, CI, integrations)Ask your operator for a client in your IdP. Use the OAuth 2.0 client credentials grant to mint access tokens

Service accounts are the right answer for anything unattended: workers, scheduled jobs, your backend calling decisions or starting processes. They don't expire with a user session, and the claims your IdP puts on their tokens decide what they may do.

Operators wiring up the IdP: see Enterprise → Authentication.

Getting a token​

For a service account using the OAuth 2.0 client credentials grant:

curl -X POST "$ISSUER/oauth/v2/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET" \
-d "scope=openid profile"

The response carries an access_token and an expires_in (in seconds). Cache the token until shortly before it expires, then mint a new one. Don't request a fresh token on every API call - your IdP will rate-limit you and your latency will suffer.

{
"access_token": "eyJ…",
"token_type": "Bearer",
"expires_in": 3600
}

The exact token endpoint URL varies by provider. Zitadel uses /oauth/v2/token and Keycloak uses /realms/{realm}/protocol/openid-connect/token. Consult your IdP's documentation.

Using the token​

Send the token in the Authorization header on every API call:

curl "$API/projects/$PROJECT/bpmn/instances" \
-H "Authorization: Bearer $TOKEN"

A few practical points:

  • Refresh before expiry, not after. If you wait until you get a 401, in-flight calls fail. Refresh when the token has, say, a minute left.
  • Tokens are bearer credentials. Anyone who has the token can act as you until it expires. Don't log them, don't commit them, and rotate the underlying client secret regularly.
  • One token per service account is fine. Multiple workers can share the same token - the IdP doesn't care, and the platform only reads claims from it.

The role model​

Two claims decide what a token may do.

Signing in​

The roles claim must contain user. A token without it is refused with 403 Forbidden on every authenticated endpoint, whatever projects it names. Every other entry in the roles claim is an identity-provider group, used only to match user tasks' candidateGroups.

Project roles​

The projects claim grants a role per project, or on every project through a "*" entry. Strict hierarchy, each role carries everything below it:

admin  ⊃  editor  ⊃  executor  ⊃  viewer
RoleCan do
viewerRead decisions and processes, view executions, instances, jobs and analytics
executorEverything viewer can do, plus: call decisions via API, start instances, publish messages and signals, list, reassign and complete user tasks, poll and complete external jobs
editorEverything executor can do, plus: create, modify, deploy and delete decisions and processes, start test runs, cancel instances, edit their variables, resolve incidents, migrate instances, and start analysis runs
adminEverything editor can do, plus: suspend and resume process definitions and instances, and modify running instances

Project memberships come from the token alone. Your IdP decides them, see Enterprise → Authentication for the claim shape.

Where the role applies​

Every endpoint requires a specific minimum project role. The most common shapes:

  • Read endpoints (list / get instances, jobs, user tasks, definitions) - viewer for most, executor for /user-tasks to keep the surface tight.
  • Action endpoints (start instance, send message/signal, complete user task, complete external job) - executor. With one exception: a user task's own assignee / candidateUsers / candidateGroups member can complete or fail it without executor - the assignment counts as authorisation. See User tasks → Access control.
  • Authoring endpoints (create / update / delete / deploy resources, test runs) and instance repair (cancel, edit variables, resolve incidents, migrate) - editor.
  • Operational control (suspend and resume, instance modification) - admin.

404 and 403​

When the token's projects claim grants no role on a project, the platform answers 404 Not Found, the same answer as for a project that doesn't exist. This avoids confirming which project IDs exist. A role that is too low for an endpoint gets 403 Forbidden.

If you're getting a 404 you didn't expect, the most common causes are:

  • The caller's token has no entry for that project and no "*" entry.
  • The project ID is wrong, or the project isn't provisioned on this installation.

Check your token's claims (decode it at jwt.io for a quick look). The project list and roles will be in there.

Token expiry and clock skew​

Two failure modes that usually trip up first-time integrators:

SymptomLikely cause
401 Unauthorized on a previously-working tokenToken expired. Mint a new one
401 Unauthorized on a freshly-minted tokenThe server's clock and your IdP's differ. The validator checks exp against the server clock and accepts an nbf (not before) at most 5 minutes in the future. Sync time on both ends
403 Forbidden on every endpointThe roles claim lacks user, or OIDC_ROLES_CLAIM points at the wrong path
Sporadic 401s under loadMultiple workers minting and immediately invalidating each others' tokens - make sure each service account uses its own token, cached locally

Where it shows up next​