如何在帐户链接期间获取Alexa用户指定的userId

编程入门 行业动态 更新时间:2024-10-06 16:25:16
本文介绍了如何在帐户链接期间获取Alexa用户指定的userId的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在帐户链接过程中,Alexa用户将被重定向并显示一个表单以输入其凭据(ID和/或密码)。根据提供的内容,然后通过身份验证流程对用户进行验证,成功后, accessToken 会嵌入到Alexa请求中,并将用户重定向到OAuth资源。

During account linking process, Alexa user is redirected and presented with a form to enter his credentials (ID and/or password). Based on what's provided, the user is then being validated by the authentication flow, upon which success an accessToken is embedded in Alexa request and the user is redirected to the OAuth resource.

是否可以通过上述交互获得的用户ID作为Alexa请求的一部分(JSON session\user\ \userId ),而不是(或除此之外)是在用户启用设备技能时生成的userId吗?还是可以从链接用户帐户后生成的 accessToken 中收集userId?

Is there a way to pass the ID of the user obtained in the above interaction as part of the Alexa request (JSON session\user\userId), instead of (or in addition to) it being a userId that gets generated during user's enabling their skill on a device? Or can the userId be gleaned from the accessToken generated after linking user's account?

推荐答案

您是否指的是OAuth提供商指定的userId?应该有一个基于 accessToken 来检索userId的API。例如,当您验证访问令牌,它将作为响应的一部分返回 user_id 。

Are you referring to the userId specified by your OAuth provider? There should be an API to retrieve the userId based on the accessToken. Using Login with Amazon for example, when you verify the access token, it would return user_id as part of the response.

如果是指获取用户的电子邮件(即登录到亚马逊帐户的 ID),您需要添加相关范围(例如 配置文件 (对于LWA),基于您的OAuth提供者,以便从 accessToken 。

If you're referring to getting the user's email (that's the "ID" to login to an Amazon account), you would need to add the relevant scope (e.g. profile for LWA) based on your OAuth provider in order to retrieve that from an accessToken.

更多推荐

如何在帐户链接期间获取Alexa用户指定的userId

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

发布评论

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

>www.elefans.com

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