简体   繁体   中英

How to register `Amazon Cognito` users with an AWS Lambda Java function?

How to register users to Amazon Cognito using an AWS Lambda function? Amazon docs are available only for Javascript . I would like to write it in Java .

Here you have aws sdk ( http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/index.html ). If you check through the left pannel you can seek for services, like CognitoIdentity.

Anyway, if I'm not wrong, some Cognito functions are made to be used from frontend, for instance the registration part. Your users should introduce their email in frontend and there you call Cognito functions to send them the confirmation email. That's why most of the examples are made in javascript.

The AWS documentation is not very good about Cognito and the API's. It's not just a Java SDK problem. Basically you will need to execute the following actions:

  1. Get one AWSCognitoIdentityProviderClient or AWSCognitoIdentityProviderAsyncClient using a builder;
  2. Create a SignUpRequest and configure it with the information of the new user;
  3. Call the SignUp method in the AWSCognitoIdentityProviderClient using the SignUpRequest as a parameter and check for the SignUpResult.

But keep in mind that are a lot more actions that need to be done in this process. Here you'll find more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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