0
votes

I'm really struggling getting my head round account linking on an alexa skill. I've written a skill to give me info back from strava, all that work fine but i need to get a token to access the users Strava account.

I've read the amazon doc but i'm still a bit confused as to how i'm supposed to set the link up. I can get the Strava login page up ok but then i just get an error back from amazon saying 'Unable to link skill' This is my setup:

Authorization URL - https://www.strava.com/oauth/authorize?client_id=XXX&response_type=code&redirect_uri=https://layla.amazon.com/api/skill/link/XXX&scope=public

The response url i've used is listed in the console

Access token url is https://www.strava.com/oauth/token

I've also filled in my secret and and put strava in the domain list, and on the strava app page made layla.amazon.com the callback domain.

I've even written a quick app to try and simulate this and it gives me a token back, so i'm not sure what i'm missing

2

2 Answers

0
votes

you need to pass to the redirect_uri the state var that you received from the first call to your server

see here: https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/linking-an-alexa-user-with-a-user-in-your-system

0
votes

I had the same issue, for me it was solved by setting the Client Authentication Scheme to Credentials in request body:

enter image description here