通过遵循亚马逊的 Alexa 文档,我很难让它发挥作用。我在 Account Linking 上搁浅,因为我不知道如何让 Login with Amazon (LWA) 请求 alexa::skills:account_linking 范围。
我已经在我的应用程序中包含了 Amazon API 库并正确设置了所有内容,我正在使用(全球可用的)亚马逊对象调用该过程,如下所示(打字稿):
const options: any = {};
options.scope = ['profile', 'alexa::skills:account_linking'];
options.scope_data = {
profile : {essential: false}
};
options.response_type = 'code';
const self = this;
amazon.Login.authorize(options, (response) => {
if (!response || !response.code) {
throw { error: response };
}
// ... send the response code to my server
// ... to be exchanged for bearer and refresh tokens
});
Run Code Online (Sandbox Code Playgroud)
我希望从中发生的是一个弹出的亚马逊登录过程,它会产生(1)让用户登录到亚马逊,并且(2)征得用户的同意,将他们的亚马逊帐户链接到我的 Alexa 技能(即链接到我的凭证托管服务),以便我们(在浏览器中)取回授权码,我们可以(在我们的服务器上)交换该授权码以获取承载和刷新令牌以代表用户执行操作。
问题是,上面的代码立即失败并且永远不会弹出进程。抛出的消息说:“请求了未知范围”。如果我从 …
amazon-web-services alexa account-linking alexa-account-linking
我有一个奇怪的问题,我整天都在想这个问题。我构建了一个通过 Amazon Web 登录 api 使用以下权限进行身份验证的应用程序:
Alexa::询问:技能:读写 Alexa::技能:account_linking
对于使用我的 Alexa 帐户的开发人员,我们可以登录并 PUT 到 /v1/skills/${ALEXA_SKILL_ID}/stages/live/enablement 端点并获取有效响应。
然而,Alexa 今天批准了我们的应用程序,事实证明,每个不是我们帐户上的开发人员的人都会顺利通过 OAUTH 流程,但是一旦他们将其放入 /v1/skills/${ALEXA_SKILL_ID}/stages/live/enablement端点,他们收到错误:
{“message”:“您无权访问该资源。”}
我已经验证了我们的客户端 ID 和密码是否正确,我们已经更新了舞台以进行直播等...但似乎没有任何效果。我可能缺少什么吗?
alexa ×1