The refresh token lets the application obtain new access tokens without the user having to log in again, as defined by OAuth 2.0. It's issued by the token endpoint of the Authentication API and can only be used once: every refresh returns a new refresh token. See Tokens — General for how it fits in the lifecycle.
A refresh token is only issued if the application has the Refresh Token grant type (refresh_token), and:
offline_access;When the access token is about to expire, the application sends the refresh token to the token endpoint, with its client authentication:
POST /oauth2/token HTTP/1.1Host: {tenant_id}.api.quasr.ioContent-Type: application/x-www-form-urlencoded grant_type=refresh_token&refresh_token={refresh_token}&client_id={client_id}The response contains a new access token and a new refresh token, but no identity token:
{ "token_type": "Bearer", "access_token": "{access_token}", "expires_in": 86400, "expires_at": 1767312000, "refresh_token": "{new_refresh_token}"}INVALID_PARAMETER (body.refresh_token).| Claim | Description |
|---|---|
sub | The ID of the account. |
client_id | The ID of the application the token is issued to. |
scope | The granted scopes, carried over to new access tokens. |
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: oauth2:refresh. |
https://api.quasr.io/claims/clm | The granted claims. |
https://api.quasr.io/claims/atr | The IDs of the attributes to include in the identity token. |
https://api.quasr.io/claims/ata | The IDs of the attributes to include in the access token. |
https://api.quasr.io/claims/max | The latest moment the token (and tokens obtained with it) can expire, from the consent. |
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 refresh token (decrypted):
{ "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": 1767830400, "https://api.quasr.io/claims/typ": "oauth2:refresh", "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": false, "https://api.quasr.io/claims/ipa": "203.0.113.42", "https://api.quasr.io/claims/ten": "{tenant_id}"}Refresh tokens are configured per application (see Applications — Configuration):
config.tokens.refresh.exp) - How long the application can obtain new tokens. 1 week by default, at most 1 year.config.tokens.refresh.enc) - Whether the token is encrypted, so its content can only be read by Quasr. Enabled by default.config.tokens.refresh.ipb) - Whether the token can only be used from the IP address it was issued to. Disabled by default.Refresh tokens can only be used once (use is fixed at 1).
POST oauth2/revoke, in the Admin UI or Account UI, and are revoked when the user is locked. See Revocation.