简体   繁体   English

将AccessToken推送到AWS Lambda函数

[英]Push AccessToken to AWS Lambda Function

After User is confirmed (verified) in the end of the SignUp stage in Mobile App, how i can push his AccesToken to Lambda function which will be necessary for my lambda method (in Python 2.7) below, 在Mobile App的SignUp阶段结束时确认(验证)User之后,如何将他的AccesToken推送到Lambda函数,这对于下面的我的lambda方法(在Python 2.7中)是必需的,

def lambda_handler(event, context):
  response = client.get_user(
       AccessToken='string')

"get_user" Method which i want to use in AWS Lambda 我想在AWS Lambda中使用的“ get_user”方法

My lambda function is already attached to Cognito-Post Confirmation Trigger. 我的lambda函数已经附加到Cognito-Post确认触发器。 This AccessToken only need after Confirmed Sign-Up to get the Username of the newly added User, not necessary in every "Log in" of User into the App. 仅在确认注册后才需要此AccessToken来获取新添加的用户的用户名,而无需在用户每次“登录”到应用程序时都需要此AccessToken。 I ll be glad if you can let me know how to push AccessToken of User to Lambda function in post-confirmation trigger. 如果您可以让我知道如何在后确认触发器中将User的AccessToken推送到Lambda函数,我会很高兴。

我的Cognito发布确认触发设置

If i understand you correctly, you want to get user information in the post confirmation trigger. 如果我正确理解您的要求,则希望在后确认触发器中获取用户信息。 In that case, you can do the following: http://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html#aws-lambda-triggers-post-confirmation-example 在这种情况下,您可以执行以下操作: http : //docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html#aws- λ-触发器,后确认,例如

event['userName'] should give you the username. event ['userName']应该为您提供用户名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM