question

newuser-79732c0c-940b-4ce1-a7f7-1efaf5982c2a avatar image
newuser-79732c0c-940b-4ce1-a7f7-1efaf5982c2a asked ·

android app accesstoken expired

I get an accesstoken by authorizing from an AVS Product,and it works well.But the accesstoken expired after about one hour,how can i get a new one?Still use AuthorizationManager.getToken?Is there any api helping us to get the expired time?

alexa voice serviceandroid
10 |2000 characters needed characters left characters exceeded

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

1 Answer

Steve avatar image
Steve answered ·

You should consider using a refresh token, since they are valid indefinitely. You'll only need to refresh them on expiration. You can find more information about refresh tokens here:

https://developer.amazon.com/public/apis/engage/login-with-amazon/docs/refresh_token.html

5 comments
10 |2000 characters needed characters left characters exceeded

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

I absolutely understand your solution,but I didn't find the api to get a refresh token in login-with-amazon-sdk.jar.Should I use the method of https to get one?If so, why do Amazon developers not add an interface to login-with-amazon-sdk.jar?

0 Likes 0 ·
nm@Amazon avatar image nm@Amazon newuser-79732c0c-940b-4ce1-a7f7-1efaf5982c2a ·

Hi @NewUser-79732c0c-940b-4ce1-a7f7-1efaf5982c2a You get the refresh token along with access token whenever you successfully login with amazon. Please also consider securely storing the refresh token.

0 Likes 0 ·

I didn't find refresh token and no expired time in login-with-amazon-sdk.jar. I coded by reference to this:https://developer.amazon.com/public/apis/engage/login-with-amazon/docs/use_sdk_android.html

0 Likes 0 ·
Show more comments