Tokens

Tokens

Quasr issues self-contained JSON Web Tokens (JWTs). Your applications receive the standard OAuth 2.0 and OpenID Connect tokens: the access token (to call APIs), the refresh token (to obtain new tokens) and the identity token (with the user's identity claims). The other tokens are used internally during login and signup.

Types

Token Purpose Used By Default Lifetime Configured Per
SessionTracks a login or signup in progress, its score and factors passedLogin UI1 day (login), 15 minutes (signup)Tenant
ConsentCaptures the scopes, claims and attributes granted to the applicationLogin UI5 minutes (one-time use)Tenant
Authorization CodeExchanged by the application for tokens (OAuth 2.0)Application5 minutes (fixed)Application
AccessAuthorizes requests to APIs (OAuth 2.0)Application, API1 day (max 30 days)Application
RefreshObtains new access tokens without a new login (OAuth 2.0), if the scope contains offline_accessApplication1 week (max 1 year, one-time use)Application
IdentityConveys the identity of the user to the application (OpenID Connect), if the scope contains openidApplication5 minutes (max 1 day)Application

Lifecycle

The tokens follow each other during a login (or signup) as follows:

  1. The application sends the user to the authorization endpoint, which redirects to the Login UI.
  2. The user passes factors, and the Login UI receives a session token, see Factors — Authentication API.
  3. Once the session score is sufficient and the controls are passed, the Login UI exchanges the session token for a consent token.
  4. The Login UI sends the user back to the authorization endpoint with the consent token, which redirects to the application with an authorization code.
  5. The application exchanges the authorization code at the token endpoint for an access token, plus an identity token if the scope contains openid and a refresh token if it contains offline_access.
  6. When the access token expires, the application uses the refresh token to obtain a new access token and refresh token.

Machine applications skip the login and request an access token directly, see Applications — Machine (M2M).

Format

All tokens are JWTs signed by Quasr with RS256, using 2048-bit RSA keys held in AWS Key Management Service (see Security). The key ID (kid) in the header refers to the public key in your tenant's key set. Tokens contain following types of claims:

  • Standard claims - e.g. iss (your tenant: https://{tenant_id}.api.quasr.io), sub (the account ID), aud, exp, iat, jti, scope and client_id.
  • System claims - Claims prefixed with https://api.quasr.io/claims/ used by Quasr itself, e.g. typ (the token type), ten (the tenant), scr (the session score) and fct (the factors passed).
  • Custom claims - Claims from attributes released by controls, and from extensions, in access and identity tokens.

Tokens can also be encrypted (JWE, RSA-OAEP-256 with A128CBC-HS256):

  • session, consent, refresh tokens and authorization codes are encrypted by default with Quasr's own keys, so only Quasr can read them
  • access and identity tokens can be encrypted with the keys of your own back-end or application (Access / Identity Token Encryption), so only they can read them

Validation

Applications and APIs validate tokens themselves with the public keys of your tenant, published at https://{tenant_id}.api.quasr.io/.well-known/jwks.json (also listed in the discovery document). Always:

  • verify the signature with the key matching the kid, and only accept RS256
  • select the key by kid from the key set instead of pinning a single key, and fetch the key set again when a token has a kid you don't know: signing keys are rotated yearly, and new keys are published in the key set well before they're used
  • check that iss is https://{tenant_id}.api.quasr.io, aud contains your API (or client ID for identity tokens) and the token isn't expired (exp)
  • check the scope (access tokens) for the permissions the request needs

Local validation can't detect a revoked token. If you need that for access tokens, use the introspection endpoint (POST oauth2/introspect), which returns whether an access token is still active. It requires an access token with the https://api.quasr.io/scopes/oauth2/introspect scope. See Standards — JWT and APIs — Authentication.

Revocation

Tokens valid for 1 hour or more are tracked by Quasr and can be revoked before they expire. Shorter tokens, such as identity tokens, consent tokens and authorization codes, expire quickly and aren't tracked. Tracked tokens are revoked:

  • with the revocation endpoint (POST oauth2/revoke)
  • in the Admin UI in the Tokens screen or an account's Tokens tab, or with the listTokens and updateToken operations of the Management API
  • by users themselves, for their own tokens, in the Account UI
  • automatically when a user is locked, and for the previous session token on every successful factor
  1. 1A login session: tracked, as it lasts a day
  2. 2Used: a one-time refresh token, replaced by a new one when the application refreshed
  3. 3Revoked: here because its user was locked

The tokens of one account, in its Tokens tab

  1. 1Users revoke their own tokens, e.g. a login session on a device they no longer use

Security Options

Next to encryption, following options protect tokens. They're configured per application for access, refresh and identity tokens and authorization codes (see Applications — Configuration), and per tenant for session and consent tokens:

  • IP binding (ipb) - The token can only be used from the IP address it was issued to. This protects against token theft, but breaks when users switch networks.
  • Usage limit (use) - How often a token can be used. Consent tokens, authorization codes and refresh tokens can only be used once, so a stolen one can't be reused after it was used.
  • Lifetime (exp) - Shorter lifetimes limit the impact of a leaked token.
2026.11.21 | © Copyright 2026 Quasr BV