ask-smapi-sdk Authentication Failed error_description: 'Client authentication failed', error: 'invalid_client'

181 views Asked by At

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();
1

There are 1 answers

0
LetMyPeopleCode On

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.