I am developing an app to use aws cognito to manage my user authentication. The way I understand is, once authenticated, I will receive an access token and a refresh token. The access token is short-lived and I will have to use the refresh token to periodically get new ones. However, the problem I have is the refresh token also have an expiry date. What happen when the refresh token expires, do I ask users to log in again in the app? The Facebook app or the linkedin app seem to have users logged in permanently. Only a fresh re-install of the app would prompt users to log in again. One way I can think of is to keep the username and password saved in the app, but wouldn't that defeats the purpose of this token based authentication? So, what is a correct way to permanently log in users like Facebook app?
AWS documentation says
By default, the refresh token expires 30 days after the user authenticates. When you create an app for your user pool, you can set the app’s Refresh token expiration (days) to any value between 1 and 3650.
Expiration 3650 means about 10 years what you can pretty much regard as " forever".
Details here http://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html
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