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

编程入门 行业动态 更新时间:2024-10-06 14:31:21
本文介绍了为 Amazon Alexa Connected Home 技能设置 Oauth 的简单方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

我已经尝试按照

填写所需信息并点击保存.

第 2 步 - 获取您的 OAuth 凭据

您新创建的安全配置文件现在将出现在 Login with Amazon Configurations 列表中.

您将收到客户端 ID 和客户端密钥.请在提交您的技能适配器以进行测试配置时提供此信息.

点击显示.

第 3 步 - 将您的 Alexa Connected Home 技能列入白名单

接下来,我们需要在您的 Login with Amazon 安全配置文件中将 Alexa Connected Home 技能的端点列入白名单.首先,输入您的安全配置文件的 Web 设置:

接下来,点击页面上的编辑,并输入以下数据:

  • 这是我停止遵循那篇博文中的说明的时候.我现在设置了允许的来源和允许的返回网址.Allowed Origins 应该是 amazon,Allowed Return URLs 应该是 Redirect URL 从 Alexa 开发者控制台的帐户链接页面复制

  • 从 Login With Amazon 控制台复制 Client Id 和 Client Secret 并将它们粘贴到 Client Id 和Alexa 开发者控制台的 Client Secret 字段.

I'm trying to prototype an Alexa Connected Home skill and one of the requirements is linking a user's account using Oauth 2.0. Since I'm just building a prototype and I don't have an Oauth server up and running what's the easiest way for me satisfy Amazon Oauth requirement?

I've tried following the instructions on Tips for Using Login with Amazon in Alexa Connected Home CoHo Skills but it failed with an uninformative error message no matter what I tried.

  • Has anyone gotten Login with Amazon to work with Alexa Connected Home?
  • Is there an easy to use Oauth provider that I could use?

解决方案

tl;dr

Login With Amazon Console:

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

Alexa Developer Console:

Authorization URL: www.amazon/ap/oa Access Token URI: api.amazon/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.>

I was able to use Login with Amazon as the Oauth provider. I followed the documentation in the Login with Amazon Web Developer Guide and found the configuration that I had been missing.

To get Login With Amazon to work I did the following:

  • Open the Amazon Alexa developer console and go to the configuration tab of your skill (the page that has the information about Account Linking.

  • Set the Authorization URL to www.amazon/ap/oa

  • Set the Scope to profile:user_id

  • Set the Access Token URI to api.amazon/auth/o2/token

  • copy the Redirect URL that is in this page for the Login with Amazon configuration (example Redirect URL: pitangui.amazon/api/skill/link/xxxxxxxxx ).

  • Follow Steps 1, 2, and most of 3 from Tips for Using Login with Amazon in Alexa Connected Home CoHo Skills for "Using Login with Amazon as your OAuth provider".

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.

Fill in the required information and hit Save.

Step 2 - Obtain Your OAuth Credentials

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

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

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:

Next, click Edit on the page, and enter the following data:

  • This is when I stopped following the instructions from that blog post. I now set the Allowed Origins and Allowed Return URLs. The Allowed Origins should be amazon, and the Allowed Return URLs should be the Redirect URL copied from the Account Linking page from the Alexa Developer Console

  • Copy both the Client Id and the Client Secret from the Login With Amazon Console and paste them into the Client Id and Client Secret fields of the Alexa Developer Console.

更多推荐

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

本文发布于:2023-11-28 04:28:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1640964.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:技能   简单   方法   Alexa   Amazon

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!