Amazon Cognito 能否替代 Login-With-Amazon SDK?

Can Amazon Cognito be a substitute for the Login-With-Amazon SDK?

我有一个 ios 应用程序使用 Cognito 进行身份验证。当我进一步研究亚马逊必须提供的服务时,我遇到了亚马逊的 Alexa 语音服务和 Alexa 技能套件。通过亚马逊的文档,有人提到我必须使用 Login-With-Amazon SDK 进行身份验证,然后我才能访问 Alexa 语音服务。我真的需要知道是否有解决方法。在检查用户名和密码是否已在我的 dynamoDB table 中注册后,我允许从我的应用程序进行未经身份验证的访问。我还必须使用 Login-With-Amazon SDK 吗?没有它我可以让 Alexa 工作吗?

您可以将 Amazon 添加为 Cognito 身份池的提供商,然后您可以使其与 Amazon 帐户一起使用。

用户必须使用 Login With Amazon SDK (LWA) 登录他们的 Amazon 账户,无论他们是否正在使用通过 mobile app, a website, or calling the REST API directly, you'll need an access token from LWA. A good overview of the auth flow is in the Getting Started Guide. So you will not be able to allow unauthenticated (i.e. anonymous) users to call the AVS. Cognito has a documented way to integrate LWA现有的未经身份验证的代码,但您的用户必须先登录亚马逊,然后您才能使用 AVS。

一位亚马逊人在 this thread 中用声明澄清了为什么需要这样做的解释:

For AVS, we need the user's permission to access THEIR account data. That means you'll need to get an access token via the LWA SDK.

值得注意的是,Alexa 语音服务旨在供 Alexa 设备而非移动应用程序使用。例如,echosim.io消费语音服务。

如果您仍想将 Alexa 风格的技能添加到您的 iOS 应用程序,我建议您查看 Amazon Lex(通过 AWS),它在您最初提出问题后就可用了。您可以创建利用 Alexa 技术的语音或文本聊天机器人,您的用户可以使用 Cognito 登录。