Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
703 views
in Technique[技术] by (71.8m points)

amazon-web-services - 从Lambda函数读取访问令牌时出现问题(Issue when reading access token from lambda function)

We have created a custom skill and this has been published.

(我们已经创建了一种自定义技能,并且已经发布。)

We are doing account linking.

(我们正在进行帐户关联。)

In the Amazon dev console we are using Amazon account for linking purpose.

(在Amazon开发控制台中,我们使用Amazon帐户进行链接。)

Below are the details of the value we have put in the Alexa Skill Account linking configuration.

(以下是我们在Alexa技能帐户链接配置中输入的值的详细信息。)

Security Provider Information

(安全提供者信息)

Grant Type: Auth Code Grant

(授予类型:授权码授予)

Authorization URI: https://www.amazon.com/ap/oa

(授权URI: https//www.amazon.com/ap/oa)

Access Token URI: https://api.amazon.com/auth/o2/token

(访问令牌URI: https//api.amazon.com/auth/o2/token)

Your Client ID: XXXXXXXX

(您的客户编号:XXXXXXXX)

Your Secret: XXXXXXXX

(您的秘密:XXXXXXXX)

Your Authentication Scheme: HTTP Basic

(您的身份验证方案:HTTP基本)

Scope: profile

(范围:简介)

Please note, LWA Account linking is done successfully.

(请注意,LWA帐户链接已成功完成。)

When we are invoking the skill through Alexa simulator its getting invoked successfully.

(当我们通过Alexa模拟器调用该技能时,它会被成功调用。)

The ultimate goal is to get the Amazon username/phonenumber through which the account linking is done.

(最终目标是获取用于完成帐户链接的亚马逊用户名/电话号码。)

We presume that we will get these details using Access Token value.

(我们假设将使用访问令牌值获取这些详细信息。)

Issue what we are facing while trying to read the access token in the Lambda function.

(发出我们在尝试读取Lambda函数中的访问令牌时面临的问题。)

(Please note that this function are being developed using Alexa.NET NuGet package in C#)

((请注意,此功能是使用C#中的Alexa.NET NuGet包开发的))

We tried below methods:

(我们尝试了以下方法:)

  public async Task<SkillResponse> FunctionHandler(SkillRequest input, ILambdaContext context)

    {

        try

        {

            var accessToken = input.Context.System.User.AccessToken;// Access Token is NULL

            var personToken = input.Context.System.Person; // Person Class object is returned NULL

            var accessSessionToken = input.Session.User.AccessToken; ;// Access Token is NULL

                     }

            }
  ask by Pratik B translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...