简体   繁体   English

Strava的Alexa Skill链接帐户

[英]Alexa Skill link account with Strava

I'm really struggling getting my head round account linking on an alexa skill. 我真的很想让我的头目帐户链接到alexa技能。 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. 我已经写了一种技巧,可以从strava给我回信息,一切正常,但是我需要获得令牌才能访问用户Strava帐户。

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: 我可以正常设置Strava登录页面,但是随后我从亚马逊回来时看到一条错误消息,说“无法链接技能”,这是我的设置:

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 授权网址-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 控制台中列出了我使用的响应URL

Access token url is https://www.strava.com/oauth/token 访问令牌网址为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. 我还填写了我的秘密,并将strava放入域列表中,并在strava应用程序页面上将layla.amazon.com设置为回调域。

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 您需要将您从第一次调用服务器收到的状态var传递给redirect_uri

see here: https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/linking-an-alexa-user-with-a-user-in-your-system 参见此处: 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: 我遇到了同样的问题,对我来说,这是通过在请求正文中将“客户端身份验证方案”设置为“凭据”来解决的:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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