本文介绍了将 Alexa 与 Twitter 关联的帐户 - Amazon Echo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

截至目前,我似乎无法将我的 Alexa 技能与 twitter 联系起来.目前,我有一个在 EBS 上运行的节点/快速服务器,我正在使用 passport-twitter处理身份验证的 oauth 部分.现在我的流程是这样的:

As of now I cannot seem to get my Alexa skill linked with twitter. Currently, I have a node/express server running on EBS which, I am using passport-twitter to handle the oauth part of the authentication. Right now my flow is such:

  1. 在 Alexa 应用中启用技能
  2. 在 alexa 应用中点击登录帐户"
  3. 显示 Twitter 登录屏幕,我输入用户名和密码,然后单击登录按钮
  4. 在通过身份验证后重定向到亚马逊提供的回调网址,并获得无法链接您的技能".

我登录了一切,所以我认为问题在于重定向,它在我的快速服务器上的 twitter auth 回调中定义,如下所示:

I login and everything, so I think issue is with redirection, which is defined in the twitter auth callback on my express server like so:

app.get('/auth/twitter/callback',
passport.authenticate('twitter', {failureRedirect: '/login'}),
function(req, res){

  var redirectUrl= 'https://pitangui.amazon.com/spa/skill/account-linking-status.html?vendorId=M28J2SR508CPU9#state='
  +state+'&access_token='+myToken+'&token_type=Bearer';

  res.redirect(302, redirectUrl);
});

我的重定向 url,减去敏感数据,是https://pitangui.amazon.com/spa/skill/account-linking-status.html?vendorId=M28J2SR5BLAH#state=&access_token=&token_type=Bearer

My redirect url, minus the sensitive data, ishttps://pitangui.amazon.com/spa/skill/account-linking-status.html?vendorId=M28J2SR5BLAH#state=&access_token=&token_type=Bearer

任何有关如何调试/故障排除的想法以及解决问题的任何建议都将不胜感激.

Any ideas on how to debug/troubleshoot as well as any suggestions to fix issue would be awesomely appreciated.

推荐答案

在 'state' URL 参数前有一个散列 ('#').也许你的意思是它是一个&符号('&')?

You have a hash ('#') before the 'state' URL parameter. Perhaps you meant for that to be an ampersand ('&')?

https://pitangui.amazon.com/spa/skill/account-linking-status.html?vendorId=M28J2SR5BLAH&state=&access_token=&token_type=Bearer

这篇关于将 Alexa 与 Twitter 关联的帐户 - Amazon Echo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 23:29