简体   繁体   中英

Alexa Skill link account with Strava

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

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

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

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM