The session token tracks a login or signup in progress. It's issued to the Login UI (or your own UI) by the factors endpoint of the Authentication API, and holds the account, the score of the session and the factors passed. The UI uses it as bearer token to pass more factors and, once the score is sufficient, to obtain a consent token. See Tokens — General for how it fits in the lifecycle.
Every successful factor returns a new session token, together with the session score and expiry:
{ "result": "SUCCESS", "feedback": { "cause": "", "enrollment_id": "{enrollment_id}" }, "account_id": "{account_id}", "session_token": "{session_token}", "session_score": 3, "session_exp": 1767312000}Our Login UI shows the time left of the session:
A signup session
A login session after the first factor
Pass it as bearer token in the next requests to the factors and controls endpoints:
POST /factors HTTP/1.1Host: {tenant_id}.api.quasr.ioAuthorization: Bearer {session_token}Content-Type: application/json [ { "id": "{enrollment_id}", "input": "{input}" }]POST /controls?client_id={client_id}, which is converted into a login session (with the login lifetime) once the signup is complete. See Login & Signup.| Claim | Description |
|---|---|
sub | The ID of the account. |
scope | The mode of the session: https://api.quasr.io/scopes/login or https://api.quasr.io/scopes/signup. |
iss | The issuer, i.e. your tenant: https://{tenant_id}.api.quasr.io. |
aud | The audience: https://api.quasr.io. |
iat / nbf / exp | When the token was issued, is valid from and expires. |
jti | The unique ID of the token. |
https://api.quasr.io/claims/typ | The token type: session. |
https://api.quasr.io/claims/scr | The score of the session, i.e. the sum of the scores of the factors passed. |
https://api.quasr.io/claims/fct | The IDs of the factors passed. A factor can only be used once per session. |
https://api.quasr.io/claims/int | Whether the account is internal. |
https://api.quasr.io/claims/use | How often the token can be used: 0 (unlimited). |
https://api.quasr.io/claims/ipb | Whether the token is bound to the IP address in ipa. |
https://api.quasr.io/claims/ipa | The IP address the token was issued to. |
https://api.quasr.io/claims/ten | The ID of the tenant. |
An example session token:
{ "scope": "https://api.quasr.io/scopes/login", "sub": "{account_id}", "jti": "{token_id}", "aud": "https://api.quasr.io", "iss": "https://{tenant_id}.api.quasr.io", "iat": 1767225600, "nbf": 1767225600, "exp": 1767312000, "https://api.quasr.io/claims/typ": "session", "https://api.quasr.io/claims/scr": 3, "https://api.quasr.io/claims/fct": [ "{email_factor_id}", "{password_factor_id}" ], "https://api.quasr.io/claims/int": false, "https://api.quasr.io/claims/use": 0, "https://api.quasr.io/claims/ipb": false, "https://api.quasr.io/claims/ipa": "203.0.113.42", "https://api.quasr.io/claims/ten": "{tenant_id}"}Session tokens are configured per tenant (see Tenants — Configuration), separately for internal and external users and for login and signup sessions (config.tokens.{internal|external}.{login|signup}):
exp) - Login sessions last 1 day for external and 1 hour for internal users by default (at most 1 year); signup sessions 15 minutes (at most 1 hour).enc) - Whether the token is encrypted, so its content can only be read by Quasr. Enabled by default.ipb) - Whether the token can only be used from the IP address it was issued to. Enabled by default for internal users, disabled for external users.Session tokens can be used any number of times (use is fixed at 0).
Login sessions
Signup sessions