oauth - 为 Amazon Alexa Connected Home 技能设置 Oauth 的简单方法是什么?

标签 oauth amazon-echo

我正在尝试对 Alexa Connected Home 技能进行原型(prototype)设计,其中一项要求是使用 Oauth 2.0 链接用户帐户。由于我只是在构建一个原型(prototype)并且我没有启动和运行 Oauth 服务器,因此满足 Amazon Oauth 要求的最简单方法是什么?

我已尝试按照 Tips for Using Login with Amazon in Alexa Connected Home CoHo Skills 上的说明进行操作但无论我尝试什么,它都失败了,并显示了无意义的错误消息。

  • 有没有人通过亚马逊登录以使用 Alexa Connected Home?
  • 是否有我可以使用的易于使用的 Oauth 提供程序?
  • 最佳答案

    tl;博士

    使用亚马逊控制台登录:

    Allowed Origins: https://amazon.com
    Allowed Return URLs: <copied from "Redirect URL" in the Alexa Developer Console>
    

    Alexa 开发者控制台:
    Authorization URL: https://www.amazon.com/ap/oa
    Access Token URI: https://api.amazon.com/auth/o2/token
    Scope: profile:user_id
    Client Id: <copied from "Client Id" in the Login With Amazon Console. eg. amzn1.application-oa2-client.xxxxxxxxxxx >
    Client Secret: <copied from "Client Secret" in the Login With Amazon Console.>
    

    我能够使用 Login with Amazon 作为 Oauth 提供者。我按照 Login with Amazon Web Developer Guide 中的文档找到了我一直缺少的配置。

    为了让 Login With Amazon 工作,我做了以下工作:
  • 打开 Amazon Alexa 开发者控制台,进入技能的配置选项卡(包含 Account Linking 信息的页面。
  • 设置 授权 URL https://www.amazon.com/ap/oa
  • 范围 设置为 profile:user_id
  • 访问 token URI 设置为 https://api.amazon.com/auth/o2/token
  • 复制此页面中用于使用 Amazon 登录配置的 重定向 URL (例如重定向 URL:https://pitangui.amazon.com/api/skill/link/xxxxxxxxx)。
  • 遵循 Tips for Using Login with Amazon in Alexa Connected Home CoHo Skills 中的步骤 1、2 和 3 中的大部分,以获取“使用 Amazon 登录作为您的 OAuth 提供者”。

  • Step 1 - Create a New Security profile

    To create a new security profile on Login with Amazon, go the Developer Console and navigate to Login with Amazon by clicking on Apps & Services. Once you are on the Login with Amazon developer console page, click the Create a New Security Profile button.

    https://cdn.amazonblogs.com/developer_blog/images/lwa5.png

    Fill in the required information and hit Save.

    https://cdn.amazonblogs.com/developer_blog/images/lwa6.png

    Step 2 - Obtain Your OAuth Credentials

    Your newly created security profile will now be available in the list of Login with Amazon Configurations.

    https://cdn.amazonblogs.com/developer_blog/images/lwa7.png

    You will receive the Client ID and Client Secret. Please include this information when you submit your skill adapter for test provisioning.

    https://cdn.amazonblogs.com/developer_blog/images/lwa8.png

    Click Show.

    Step 3 - Whitelist Your Alexa Connected Home Skill

    Next, we need to whitelist the Alexa Connected Home skill’s endpoints within your Login with Amazon security profile. First, enter the Web Settings of your security profile:

    https://cdn.amazonblogs.com/developer_blog/images/lwa9.png Next, click Edit on the page, and enter the following data:


  • 这是我停止遵循该博客文章中的说明的时候。我现在设置 Allowed Origins Allowed Return URLs Allowed Origins 应该是 https://amazon.com ,并且 Allowed Return URLs 应该是 Redirect URL Redirect URL 从 Alexa 开发者控制台 0x104 的帐户链接页面复制
  • 从 Login With Amazon 控制台复制 客户端 ID 客户端密码 并将它们粘贴到 客户端 ID 和 0x1045467919 的 Alexa 开发人员字段 0x1045467919 客户端密码 0x
  • 关于oauth - 为 Amazon Alexa Connected Home 技能设置 Oauth 的简单方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37512303/

    相关文章:

    Spring OAuth2 不会在表单登录时重定向回客户端

    node.js - Alexa 如何在技能设置中使用德语同时用英语发音?

    javascript - 根据日期/亚马逊槽类型从 API 返回数据

    java - 使用 google oauth java 客户端库在 Google App Engine 中实现 Twitter OAuth

    security - 隐藏 oauth secret

    c# - 无法使用 Microsoft Live OAuth 服务添加多个重定向 URL

    Facebook 重定向 URL 问题 OAuthException

    Android 应用程序作为 Amazon Echo 的新设备

    amazon-web-services - 当我为 Alexa 技能集创建函数时,Lambda ARN(亚马逊资源名称)没有显示在右上角

    alexa - 如何为网络或移动应用程序使用亚马逊 alexa api?