A developer is securing a feedback collection REST API hosted on Amazon API Gateway. The requirement is to allow access only to authenticated corporate users who reside in an Amazon Cognito User Pool. Which two steps should the developer perform to implement this authentication mechanism? (Select TWO).
- Create an Amazon API Gateway authorizer of type Cognito and select the Cognito User Pool.Cevap
- Configure the API Gateway resource methods to use the Cognito authorizer.Cevap
- CConfigure an Amazon Cognito Identity Pool to authenticate requests and associate it directly with the API Gateway resource.
- DWrite a custom AWS Lambda authorizer that manually decodes and validates the Cognito JSON Web Tokens (JWT).
- EConfigure the API Gateway resource with a Lambda proxy integration to handle user pool authentication inside the backend integration code.
Cevap
To secure the API using an Amazon Cognito User Pool, the developer must create a Cognito authorizer in API Gateway pointing to the User Pool, and then configure the API methods to use this authorizer.
To secure the API using an Amazon Cognito User Pool natively, the developer must first create an API Gateway authorizer of type Cognito, linking it directly to the User Pool. The developer then configures the relevant API resource methods to use this Cognito authorizer. This allows API Gateway to automatically authenticate incoming requests by validating the JWT passed in the Authorization header.
Adım Adım Çözüm
Anahtar Kavram
API Gateway Cognito Authorizers
Tahmini Süre:1m 30s