Reputation: 11
I've been trying to authenticate using the refresh token using the ask-smapi-sdk however it keeps telling me unauthorized client
this is the error:
],
response: {
error_description: 'Not authorized for requested operation',
error: 'unauthorized_client'
}
this is my code:
const refreshTokenConfig = {
clientId,
clientSecret,
refreshToken
}
const smapiClient = new alexa.StandardSmapiClientBuilder().withRefreshTokenConfig(refreshTokenConfig).client();
try{
var vendorlist = await smapiClient.getVendorListV1();
Upvotes: 1
Views: 202
Reputation: 1957
Your code seems to be following the sample in the SMAPI SDK repo readme. Without any other info, I'd suggest checking the client id and client secret to make sure they're right.
Refresh tokens must be traded for a new valid access token. So all three variables must be precisely correct or that will fail.
Upvotes: 0