-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is aws-amplify's Default Behavior When a Refresh Token Expires? #4438
Comments
When you say 'send the user to AWS Cognito for re-authentication', am I correct in assuming that you are using Hosted UI? |
Yes, I am using the Hosted UI. |
When the refresh token expires, Amplify does not automatically sign the user out nor send the user to Hosted UI. Hub does not currently emit an event when a refresh token expires. What behavior would best work for your use case in this scenario? Please feel free to describe it in a new feature request. |
Is your feature request related to a problem? Please describe. Describe the solution you'd like Describe alternatives you've considered Additional context |
Hi @ErikOwen - thanks for providing this info. I will make this a feature request and leave this open so the team can address it. |
Hi @mauerbac, I was just curious if there was any update on this feature request. It would be very helpful for our team right now, as we're looking for a way to redirect users to the sign-in page when their token expires. Do you know of any workarounds for this in the mean time? |
Hey everyone, Reading on this feature request, I do want to callout what we offer in the library today. We do have a Hub event listener around token expiration that you can listen to and redirect your customers base on that listener coming back that the token was refreshed. Since we do not own the Hosted UI implementation, the Amazon Cognito team does, this is our recommendation. As for the callout around the expiration of the token only being able to be set to 1 day, there was an update last to allow yourself to set the expiration between 60 mins to 10 years. Please see the Whats new post here. If I am not understanding the use case correctly, please share some code snippets and/or more data on this for us. Thanks again! |
From |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Which Category is your question related to?
Auth
What AWS Services are you utilizing?
AWS Cognito
Provide additional details e.g. code snippets
My stack is a React application using aws-amplify to authenticate with AWS Cognito identity pool.
I am wondering what happens when a user authenticates into an app that is using AWS Amplify, and the refresh token validity expires for that user? Will aws-amplify automatically send the user to AWS Cognito for re-authentication? If not, is there a Hub event to catch when a user's refresh token expires?
The text was updated successfully, but these errors were encountered: