question

ceceron avatar image
ceceron asked

Can't get new authorization token

I am using Login With Amazon iOS SDK to get an authorization token to use later with AVS.

The first time (on the app start) I call the AMZNAuthorizationManager method authorize and everything works just fine. The callback block gets called and I get the token that I am able to use with the AVS api. I call the authorize method before any communication with Alexa (e.g. while restarting the downchannel). And every time I get the same cached token, unless...

Issues start after 1 hour when token becomes invalid. Obviously I can't use the old token, because then I get the authorization error. But when I call authorize again (the same code as in previous sucessful attempts), my callback block is not called anymore! I tried to debug the problem and when debugging the network stack I noticed that LWA SDK doesn't even send the authorization request.

After restarting the app, everything works well for one hour again.

The problem occurs on every iOS version I have access to (10.*, 11.*). The app is written in Swift 4.1, but was able to reproduce issue using only obj-c.

PS Is there any other method to get the authorization token? I would prefer raw http request than this uncontrollable sdk ;)

Please advise,

Mateusz Slazynski

alexa voice servicelogin with amazonios
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Ross@Amazon avatar image
Ross@Amazon answered

Hi ceceron,

Check out the Refresh Tokens documentation.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.