question

newuser-2841daea-4404-480a-aea2-432ba4ed894f avatar image

Bearer token expired, refresh token API returns error

Followed the insanely convoluted directions just to set up a Bearer/access token for SMAPI (having to download several GB to basically install Visual Studio, Python, and NodeJS just to get a bearer token is...excessive). And by the time I went to actually use the Bearer token, it had already expired. So I went to get a new Bearer token by following the directions under Retrieve an Access Token and Refresh Token, passing in grant_type ("refresh_token"), refresh_token, and the original client_id as a standard application/x-www-form-urlencoded POST request as the documentation clearly states using a well-known HTTP library for PHP.

That resulted in the following 400 Bad Request error:

{"error_description":"The request is missing a required parameter : client_secret","error":"invalid_request"}

What am I doing wrong here? The documentation has a lovely note about that exact error that makes no sense in the SMAPI refresh token context.

I also experimented a little with passing in 'client_secret' as requested (got 'unauthorized_client' for that!), trying a new device under "TV and Other Devices Settings" (as recommended by a GitHub issue tracker post I found on one of the official Alexa SDK repos), and swapping various parameters around to no avail with a couple of different error messages being output. At this point, I'm stumped and this isn't my first OAuth2 rodeo.

smapi
10 |5000

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

0 Answers