cognito.user.signOut() does not invalidate tokens
See original GitHub issueDescribe the bug
On calling state.cognito.user.signOut()
, session tokens are just removed localstorage.
The actual access tokens and refresh tokens are still valid for the lifecycle of the token.
Expected behavior This is a security issue. Best practice dictates session tokens should be invalidated server side on a logout request not just deleted on the client. (OWASP session management)
Source Code found here https://github.com/aws-amplify/amplify-js/blob/68a5ad2fe2b1d9f03cce80d1bf449e454b621760/packages/aws-amplify-react/src/Auth/SignOut.jsx
Issue Analytics
- State:
- Created 4 years ago
- Reactions:108
- Comments:108 (11 by maintainers)
Top Results From Across the Web
aws cognito invalidate token on logout - Stack Overflow
1 Answer 1 · 1 · The tokens are invalidated when used against the Cognito service. · @callo Is it possible to sign...
Read more >Revoking tokens - Amazon Cognito - AWS Documentation
Revoked tokens can't be used with any Amazon Cognito API calls that require a token. However, revoked tokens will still be valid if...
Read more >AWS Cognito User Pool Access Token Invalidation - DZone
Since the integrated tools in AWS Cognito aren't enough to invalidate a token once a sign out has been triggered, here's a helpful...
Read more >Authentication - Sign out - Android - AWS Amplify Docs
Calling signout with globalSignOut = true will invalidate all the Cognito User Pool tokens of the signed in user. If the user is...
Read more >How token revocation works in Cognito
Cognito offers a way to revoke a refresh_token and also to invalidate access_token s. But it doesn't magically solve the token invalidation ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We are all waiting for it to be fixed.
@jiachen247 Cognito issues short lived bearer access tokens (valid up to 1 hour). The access tokens are short lived (up to 1 hour) and Cognito has GlobalSignOut Api to invalidate all tokens issued in past. If you are using the cognito-identity-js sdk directly, then the
globalSignOut
method will invalidate all sessions (see use case #15 here: https://github.com/aws-amplify/amplify-js/tree/master/packages/amazon-cognito-identity-js). This i believe is what you are looking for to invalidate the server side. The user logout is specifically there as to not invalidate other sessions and just sign out the current local user.