question

eric-cantona avatar image
eric-cantona asked

a query regarding refresh tokens

Hi all, I now have AVS working reasonably well but I don't believe I have the refresh of tokens working correctly. I periodically get the following error when I try to issue a speech recognizer request: {"error":{"code":"com.amazon.alexahttpproxy.exceptions.InvalidAccessTokenException","message":"AVS was not able to validate the provided access token.”}} I issue the following to get a token that I subsequently use with a speech recognizer request: https://localhost:3000/device/accesstoken/my_device/123456/c7e0c123af439334fcb0840b I get the response: { "access": "Atza|IQEBLzAtAhUAjXbJz4fe19rsjKeo_akuPxiFELUCFHGFwG1FesFkymeYfahZjy601LcDt9DMirOUV-TXz3JITRUl9gh3JmAUIIqMhkKBJzLBEKwkjU0XjOA2REXOAjG4n5Y7Q5YrDTEUl9tc5wMwvreAnVnBgIOqvpPiN07qF5Ma4QSjJlXu8BY2ZAAEmpdaFSgUS1qjpAQxsSCL_9m4VDD21ud7uc-EMXMv0g2mvI-CNNSIT9-LtoYxJl0YnI86IUF-qO62huS_oU9OxJYbA5tFTxpkRGW8TIjTUEqNql5LhocROa2k8Uj-oTd2QnkGWKyvECgkBGjfyVj4FKDoKBRfZvhSmuo1TsNPjK_xsE19g7AZBs21zDD8IfOPpbcBI686fzeVzqG5VksH7o13XArmvKoKdZ1wukZYj5Ti_NxkeYyV", "expires": 3600 } So this token expires after an hour and I suspect this is when I get the above error. How do I refresh the token? Do I need to repeat the whole authentication process again? Thansk Eric.
alexa voice service
10 |5000

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

eric-cantona avatar image
eric-cantona answered
Can anyone help? Does no one else experience this problem? Thanks Eric.
10 |5000

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

elstryan@Amazon avatar image
elstryan@Amazon answered
To get a new access token when the first one expires you just need to make another GET request to the URL that you provided. You can do this as often as you'd like to request a new access token. This is a current known limitation of the service that the dev team is aware of.
10 |5000

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

eric-cantona avatar image
eric-cantona answered
Thanks for the update. Can I clarify something. Are you saying that the error (shown again below) is a know issue for the dev team? {"error":{"code":"com.amazon.alexahttpproxy.exceptions.InvalidAccessTokenException","message":"AVS was not able to validate the provided access token.”}} Thanks Eric.
10 |5000

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

elstryan@Amazon avatar image
elstryan@Amazon answered
You are receiving this error because your access token has expired. The known limitation of the service is that once the access token expires (after 1 hr) you will have to just make another GET request to the URL that you provided to get a fresh access token.
10 |5000

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