Amazon Cognito user management using Amazon API Gateway and AWS Lambda

Amazon API Gateway → AWS Lambda → Amazon Cognito

Deploys Amazon Cognito user pool, Amazon API Gateway REST API with AWS Lambda integration for user creation, confirmation & token retrieval in Java.

Amazon API Gateway receives the HTTP POST request containing the request details in JSON format. There are 3 POST methods exposed for create user, confirm user and login user operations.
AWS Lambda is by the API Gateway, this function written in Java uses Amazon Cognito API to create, confirm and login user.
Depending on the operation invoked, user is created, confirmed or logged in the Amazon Cognito user pool.
The Lambda function processes the Amazon Cognito API response and sends it back to the user via the API Gateway.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/apigw-lambda-cognito-sam-java

Deploy

sam buildsam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: sam delete.

Created by:

Biswanath Mukherjee

Biswanath Mukherjee

Sr. Solutions Architect working at AWS India.

Follow on LinkedIn