- Newest
- Most votes
- Most comments
The behavior you're experiencing is expected. When you set the RefreshTokenValidity to 60 minutes (1 hour), this represents the absolute time limit for your refresh token, measured from when the user initially authenticates - not from when the token is rotated.
Even though you're using refresh token rotation and receiving new tokens with each call to GetTokensFromRefreshTokenCommand, the overall refresh token lifetime remains fixed at your configured value (60 minutes). The rotation provides you with new token values, but doesn't extend the original expiration window.
After your configured RefreshTokenValidity period (1 hour) has elapsed, the refresh token will expire regardless of how many times it was rotated within that window. At that point, your user would need to authenticate again to get a new set of tokens.
If you need your users to maintain longer sessions without re-authentication, you should increase the RefreshTokenValidity setting. The default is 30 days, and you can configure it with time units of seconds, minutes, hours, or days by setting the appropriate TokenValidityUnits value in your request.
Sources
UserPoolClientType - Amazon Cognito User Pools
UserPoolClientType (AWS SDK for Java - 2.21.29)
UpdateUserPoolClient - Amazon Cognito User Pools
🔐 What Is Rotated Refresh Token Validity?
Rotated Refresh Token Validity refers to the time duration for which an old refresh token remains valid after it has been rotated (replaced) during authentication.
🟦 What is Refresh Token Rotation?
In modern authentication systems (like OAuth 2.0 or OpenID Connect):
When a user uses a refresh token to get a new access token…
The auth server invalidates the old refresh token and issues a new refresh token.
This process is called refresh token rotation.
It improves security by preventing token reuse attacks.
🟩 So What Is "Rotated Refresh Token Validity"?
It means:
How long the previous refresh token can still be used after rotation, before it becomes invalid.
Example: If the rotated refresh token validity = 3 minutes, then:
You use Refresh Token A
Server gives you Refresh Token B
Refresh Token A is still valid for 3 more minutes
After 3 minutes, only Refresh Token B can be used
🟧 Why Is This Important?
✔ Prevents token theft attacks If a stolen token is used after the validity window → it gets rejected.
✔ Improves session security Only one refresh token remains valid at a time.
✔ Supports recovery from race conditions E.g., when multiple devices or network delays cause tokens to overlap.
🟩 Typical Values
Different systems set different values:
0 seconds → Old token expires immediately
30 seconds – 5 minutes → Common setting
10 minutes → Rare, but can be used when dealing with slow mobile network
🏁 In Simple Words
Rotated Refresh Token Validity = Grace period for the old refresh token after issuing a new one.
answered a year ago
Relevant content
asked 3 years ago
asked 4 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 4 years ago

I do not see anywhere this is explicitly mentioned. Is there a documentation where this is outlined as the behavior.
It's a bit fuzzy but it's here. Search for "The new refresh token is valid for the remaining duration of the original refresh token." in https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-the-refresh-token.html