- What can you do in this situation?
- How might you configure your Auth0 environment to make such situations easier to handle in the future?
Application grants
The main issue in this scenario is the length of time for which the API access token is valid: one month. By default, Auth0 issues access tokens that last for 24 hours. Setting the token’s lifetime to 24 hours means that your partner must repeat the client credentials exchange (or whichever grant you’ve implemented) to obtain a new access token every 24 hours. To deny access to your partner due to the expiration of your contract, you can simply delete the application grant so that when their existing token expires, they cannot request a new one. You can change the lifetime of a token by setting thetoken_lifetime
option. The specific lifetime appropriate to your use case will vary, but we recommend setting this value to be as short as possible. A good starting point for determining this value would be the window you consider allowable for the delay between deleting the grant and final use of the API.
Delete an application grant
To delete an application grant, make the appropriateDELETE
call to the ’s Delete an Application Grant endpoint. As part of the call, you’ll need to specify the ID of the application grant you want to delete, which you can obtain via the Management API’s Get all Application Grants endpoint.
You can also update an Application’s grant types through the .