I can't find any documentation which explains if and how to modify the expiry time of access and identity tokens for AWS Cognito User Pools.
The documentation specifies that by default expires 1h after the emission.
Is there a way to modify the expiry time?
Access tokens can be configured to expire in as little as five minutes or as long as 24 hours. Refresh tokens can be configured to expire in as little as one hour or as long as ten years. These customizations enable Amazon Cognito customers to balance the security and usability of each application they develop.
If the refresh token is expired, your app user must re-authenticate by signing in again to your user pool. If the minimum for the access token and ID token is set to 5 minutes, and you are using the SDK, the refresh token will be continually used to retrieve new access and ID tokens.
As of August 12,2020, AWS has announced that user pools now supports customization of token expiration. Here are the steps to follow:
General Settings
.App clients
and click edit.Show Details
button to see the customization options like below: Access token expiration must be between 5 minutes and 1 day. Cannot be greater than refresh token expiration.
For further detail on AWS cognito you can follow this link.
This is currently not possible to configure for your user pool. They are set to one hour for everyone.
Edit: see Mike's comment, this has recently been added.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With