Skip to content

The authentication model

Every request to the control plane carries a bearer token, and the control plane resolves an actor from it. There is one authentication mode, and it is token.

flowchart TB
  R["Request with<br/>authorization: Bearer ..."] --> V{"Verifies as an<br/>Xratu-issued token?"}
  V -->|yes| K{"Service-account token?"}
  K -->|yes| S{"Still active in<br/>the issued-token store?"}
  K -->|no| A["Actor resolved"]
  S -->|yes| A
  S -->|no| X["Rejected:<br/>token_revoked_or_expired"]
  V -->|no| C{"External cloud token,<br/>and trust enabled?"}
  C -->|no| SYS["Unresolved:<br/>the system actor"]
  C -->|yes| I{"Issuer and audience<br/>allowed?"}
  I -->|no| SYS
  I -->|yes| A

Two kinds of bearer token

An Xratu-issued token is what you normally carry. It is a compact JWT signed with HMAC-SHA256 using the control plane's runtime shared secret, issued by xratu-control-plane, carrying the actor as its subject along with the provider and the claims the actor was resolved from.

An external cloud token is accepted directly when cloud token trust is enabled and the token's issuer is allowed. This is what makes the exchange possible in the first place: you present a provider-issued token, the control plane resolves who you are from it, and it issues you an Xratu token in return. See External identity exchange.

The order matters. A bearer is checked as an Xratu token first, and only if that fails is it considered as an external one.

What happens when resolution fails

Nothing raises an authentication error at this stage. An unresolvable token resolves to the system actor, and authorisation then rejects whatever the request was trying to do.

This is why a stale or wrong token shows up as a permission failure rather than a credential failure, and why the first thing to check after authenticating is that your resolved actor is no longer system. See Actors.

The auth posture

What the control plane will accept is a small set of values, held as control-plane state rather than process environment variables:

Setting Controls
auth.mode The authentication mode, which is token
auth.trust_cloud_tokens Whether external provider tokens are accepted at all
auth.allowed_cloud_token_issuers Which issuers are trusted beyond the built-in ones
auth.allowed_cloud_token_audiences Which audiences are accepted
auth.allowed_email_domains An optional restriction on the email claim
auth.breakglass_mode enabled, disabled or requires_approval
auth.runtime_shared_secret The secret Xratu tokens are signed with

Inspect the current posture with:

xratu auth config-get

Two of these settings determine whether authentication is possible at all.

trust_cloud_tokens gates the whole exchange. The exchange is the path to a first token, and with this setting off it returns 403 cloud token exchange is disabled.

The posture locks at finalization. Once the control plane is finalized, any request that changes mode, trust_cloud_tokens, the issuer, audience or email domain lists, or breakglass_mode is refused with 409 AUTH_RUNTIME_CONFIG_FINALIZED_LOCKED. Changing it afterwards requires the audited break-glass path. Settle your issuers and audiences before you finalize. See Post-finalization limits.

Email domain restriction

When allowed_email_domains is non-empty, an external token whose email claim is outside those domains is rejected with email_domain_not_allowed, before any mapping or authorisation happens. An empty list means no domain restriction.

Revocation applies to service accounts

Service-account tokens carry a token kind and an identifier, and every request using one is checked against the issued-token store. A token that has been revoked or has expired resolves to token_revoked_or_expired rather than an actor.

Exchanged user tokens are not tracked that way: they are bearer credentials that stop working when they expire. See Token lifetime, renewal, and revocation.

Reachability is part of the model

In a private self-hosted deployment, who can authenticate is decided first by who can reach the API. An actor who should not be able to create an organisation should not be able to authenticate at all, which is why exposing the API is a security decision rather than a convenience one. See API exposure options.

Where this model draws its lines

Credentials come from your provider. Every authentication path starts with a token your identity provider issued.

Xratu verifies, your provider authenticates. Xratu checks the token's signature, issuer, audience and claims, and maps the result onto its own actors. Obtaining the token happens with your provider. See Token acquisition.

Authentication resolves identity; bindings decide rights. What the resolved actor may do is evaluated separately from role bindings at organisation and workspace scope. See Actors.