I’m using the access token with AWS Cognito. After I give Cognito the access token, it can then assume a role, getting temporary credentials for the app to interact with AWS (storing data in S3).
Because Cognito needs a valid access token, I need to update Cognito with the valid access token every time it expires and is rotated. I do a check every time the app starts or makes a request to make sure the current access token is valid, and will update it with Cognito if a new token is granted.
I’m trying to test the apps behavior when it detects that the access token is expired, then requests a new one to supply to Cognito. I’m having issues with this flow right now. Since I have to wait an hour for the token to expire, it makes this a very long process.
Does this make sense? Is there a better way to do this? Am I missing something?
PS - I also with there was some call in the SDK to determine if the current token is still active and when it will expire. That would help me.