1

Currenty I am using Amplify SDK for using AWS Cognito in the App. After login i am retriving idToken which expires in about 30 min according to the doc. So, every time idToken expires i have to make user login again to retrieve idToken. Is there any way to get refresh idToken without making user to login again every time it expires?

I have looked into this doc but could not figure out what to do. Using Tokens with User Pools

Amar Maharjan
  • 220
  • 4
  • 12

1 Answers1

1

How are you signing in? The standard authentication will return ID, Access and Refresh tokens and the SDK will handle the refreshing of the tokens when they expire after an hour. If you are signing in through the HostedUI, you might be using implicit grant flow, which will only return ID and Access. So you will need to re-authenticate after an hour. The alternative there is to use the authorization code grant flow.

callo
  • 1,374
  • 8
  • 12