One of the advantages of using an API Gateway is that we are pushing security concerns, such as authorization, to the perimeter of our system and away from our internal resources. This simplifies the internal code and improves scalability. In this recipe, we will configure an AWS API Gateway to authorize against an AWS Cognito user pool.
Securing an API Gateway with OpenID Connect
Getting ready
You will need the Cognito user pool created in the Creating a federated identity pool recipe and the sample application created in the Implementing sign up, sign in, and sign out recipe to create the identity token used in this recipe.