Is there a way to manually expire an access token, for testing purposes?

I’m building an iOS app and have been having trouble testing how the app will behave after my access token is expired (and when the app will get a new access token). Having to wait an hour every time I want to run another test makes it really hard to do testing and take a really long time to fix a couple of bugs I have.

We don’t provide any utility to manually invalidate the access token. The access token once generated is valid for 1 hour and can be used to get user profile data.

On a slightly related note, Login with Amazon iOS sdk http://login.amazon.com/ios provides apis to authorize and fetch Authorize result AMZNAuthorizeResult which contains accessToken and user’s profile data. The exchange for accessToken to user profile data is taken care by the sdk internally.

Can you clarify your use case as to what you are using the accessToken for?

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?

–Rob

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.

Although we don’t currently have a better solution for forcing the token expiration for testing purposes, we’ve taken note of your request and will consider developing one in the future. We appreciate the input.
However, whenever you request a token from the Login with Amazon SDK for iOS, it will always return a valid token. It will fetch a fresh new token automatically if needed, to keep things simple on your side.