Amazon Cognito M2M OAuth 2.0 with custom scopes and Amazon API Gateway

Amazon Cognito → Amazon API Gateway → AWS Lambda

This pattern demonstrates how to implement machine-to-machine (M2M) authentication using Amazon Cognito, OAuth 2.0, Amazon API Gateway, and AWS Lambda.

This pattern showcases the integration of Cognito as the authentication provider, allowing requests to be authorized based on custom scopes defined in OAuth 2.0.

< 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/cognito-m2m-oauth-apigw-cdk

Deploy

cdk deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: cdk delete.

Created by:

Rushi Patel

Rushi Patel

Software Enginner at Cancer Research UK, passionate about event-driven architectures and Serverless.

Follow on LinkedIn