amazon-archives / aws-serverless-auth-reference-app

Serverless reference app and backend API, showcasing authentication and authorization patterns using Amazon Cognito, Amazon API Gateway, AWS Lambda, and AWS IAM.
Other
754 stars 193 forks source link

Token refresh #49

Open kszpirak opened 6 years ago

kszpirak commented 6 years ago

Hi

Cognito requires token refresh at least every once per hour. It invalidates token after 1 hour. So my question is this, can this app automatically obtain refreshed token if the last token refresh happened more than say 45 minutes ago? Also since it is an app, if the user puts the app to the background, the refresh will not happen if we are using something like setInterval to get new token. Are these token related issues best solved? Official AWS starter app from Ionic has absolutely no support for token refresh. Great job on this.