The consent token captures what the user granted the application: the OAuth 2.0 scopes, the claims and the attributes, based on the controls passed and the user's consents and permissions. It's issued by the controls endpoint of the Authentication API once the session is sufficient, and exchanged once at the authorization endpoint for an authorization code. See Tokens — General for how it fits in the lifecycle.
The Login UI requests the consent token with the session token, once all controls of the application are passed:
POST /controls?client_id={client_id} HTTP/1.1Host: {tenant_id}.api.quasr.ioAuthorization: Bearer {session_token}{ "result": "SUCCESS", "account_id": "{account_id}", "consent_token": "{consent_token}", "consent_exp": 1767225900, "consent_scope": [ "openid", "offline_access" ]}It then sends the user back to the authorization endpoint, with the original authorization request and the consent token:
GET /oauth2/authorize?{original_authorization_request}&consent={consent_token} HTTP/1.1Host: {tenant_id}.api.quasr.ioerror=invalid_consent.urn:ietf:params:oauth:grant-type:jwt-bearer), see Applications — Native.| Claim | Description |
|---|---|
sub | The ID of the account. |
client_id | The ID of the application the consent is for. |
scope | The granted scopes (scope controls), included in the access token. |
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 (5 minutes). |
jti | The unique ID of the token. |
https://api.quasr.io/claims/typ | The token type: online:consent. |
https://api.quasr.io/claims/clm | The granted claims (claim controls). |
https://api.quasr.io/claims/atr | The IDs of the attributes to include in the identity token, from the passed controls. |
https://api.quasr.io/claims/ata | The IDs of the attributes to include in the access token, from the passed controls. |
https://api.quasr.io/claims/max | The moment the earliest temporary consent expires (or 10 years from now). Tokens issued based on this consent token won't outlive it. |
https://api.quasr.io/claims/use | How often the token can be used: 1 (once). |
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 consent token:
{ "client_id": "{client_id}", "scope": "openid offline_access", "sub": "{account_id}", "jti": "{token_id}", "aud": "https://api.quasr.io", "iss": "https://{tenant_id}.api.quasr.io", "iat": 1767225600, "nbf": 1767225600, "exp": 1767225900, "https://api.quasr.io/claims/typ": "online:consent", "https://api.quasr.io/claims/clm": [ "email" ], "https://api.quasr.io/claims/atr": [ "{email_attribute_id}" ], "https://api.quasr.io/claims/ata": [], "https://api.quasr.io/claims/max": 2082801600, "https://api.quasr.io/claims/use": 1, "https://api.quasr.io/claims/ipb": true, "https://api.quasr.io/claims/ipa": "203.0.113.42", "https://api.quasr.io/claims/ten": "{tenant_id}"}Consent tokens are configured per tenant (see Tenants — Configuration), separately for internal and external users (config.tokens.{internal|external}.consent):
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.The lifetime (5 minutes) and usage (once) of consent tokens are fixed.
max claim limits the lifetime of all tokens issued based on the consent, e.g. when the user gave a temporary consent.