Choose whether token revocation deletes grants
A grant provides an application with access to a resource on another entity without exposing user credentials. Tokens are issued in the context of a grant. When a grant is revoked, so are all tokens issued in the context of that grant. However, when a token is revoked, the grant does not necessarily need to be revoked. You can choose whether token revocation deletes the associated grant in your tenant settings:- Go to Dashboard > Tenant Settings > Advanced.
-
In the Settings section. enable or disable the Refresh Token Revocation Deletes Grant toggle.
- Enable the toggle to delete the underlying grant when you revoke the refresh token.
- Disable the toggle to retain the underlying grant when you revoke the refresh token.
Revoke a refresh token
You can revoke a refresh token in the following ways:Using the Auth0 Dashboard
You can use the Auth0 Dashboard to revoke a user’s authorized access to the application that issued the token. This renders the refresh token invalid, which is functionally identical to revoking the token itself.- Go to Dashboard > User Management > Users, and select the name of the user to view.
- Select the Authorized Applications tab. This page lists all the applications to which the user has authorized access.
- To revoke the user’s access to an authorized application, and hence invalidate the refresh token, click Revoke.
Using the Authentication API
You can use the Authentication API’s Revoke a refresh token endpoint to revoke a refresh token. The endpoint supports access without the for applications that cannot keep the it safe (such as native apps). The application itself must have the its authentication method (tokenEndpointAuthMethod) set to none.
When you make a request, the API first validates the application credentials and then verifies whether the token was issued to the application making the revocation request. If this validation fails, the request is refused, and the application is informed of the error.
Next, the API invalidates the token. The invalidation takes place immediately, and the token cannot be used again after the revocation. Each revocation request invalidates all the tokens that have been issued for the same authorization grant.
For more information, including body parameters, response schemas, and code examples, read the Revoke a refresh token endpoint Authentication API documentation.
Using the Management API device credentials endpoints
To revoke a refresh token using the Auth0 Management API device credentials endpoints:-
Get the
idof the refresh token you want to revoke using the Retrieve device credentials endpoint. Specifytype=refresh_tokenand auser_idwith an access token containing theread:device_credentialsscope. To narrow the results, you can also specify theclient_idassociated with the token (if known). -
Revoke the refresh token using the Delete a device credential endpoint. Specify an access token containing the
delete:device_credentialsscope and the refresh token ID.
Using the Management API refresh token endpoints
The Auth0 Management API refresh token endpoints are currently only available to customers on Enterprise plans. To learn more, read Pricing.
/v2/device-credentials resource endpoints with extended properties and bulk revocation operations.
You can view or revoke a specific refresh token with the following endpoints:
- View a refresh token information by ID with the Get a refresh token endpoint
- Revoke a refresh token by ID with the Delete a refresh token endpoint
- List all refresh tokens for a user with the Get refresh tokens for a user endpoint
- Revoke all refresh tokens for a user with the Delete refresh tokens for a user endpoint
Considerations and limitations
- With the Device Authorization Flow, the only way to force a device to reauthorize is to revoke the refresh token assigned to the device. The device will not be forced to reauthorize until the current access token expires and the application tries to use the revoked refresh token. For more information, read Unlink Devices from Users.
- When using Refresh Token Rotation, if a previously invalidated token is used, the entire set of refresh tokens issued since that invalidated token was issued will immediately be revoked, requiring the end-user to re-authenticate.
-
Refresh token revocation (
DELETE) operations run asynchronously, and are eventually consistent. -
Refresh tokens issued on or after 21-09-2023 (22-02-2024 for tenants in the US-3 region) contain the session ID (
session_id) property with the appropriate value. Refresh tokens issued before this date contain this property with anullvalue.