A developer is securing a new Amazon API Gateway REST API. The developer wants to restrict access so that only authenticated users from an Amazon Cognito User Pool can call the API. Which TWO configuration steps are required to set up this built-in authorization mechanism?
- Create an API Gateway authorizer of type Cognito and configure it with the Amazon Cognito User Pool details.Cevap
- Set the authorization type of the API method to the Cognito authorizer that was created.Cevap
- CCreate an API Gateway authorizer of type Cognito and configure it with the Amazon Cognito Identity Pool ID.
- DCreate an API Gateway Lambda authorizer to manually decode and validate the Cognito JSON Web Token (JWT).
- EEnable Lambda proxy integration and write custom logic in the backend function to validate the client's IAM credentials.
Cevap
To implement native Amazon Cognito User Pools authorization for an API Gateway REST API, the developer must first create an authorizer of type Cognito linked to the Cognito User Pool, and then configure the target API methods to use this authorizer.
To secure an API using built-in Cognito validation, API Gateway requires setting up a Cognito authorizer that targets the Cognito User Pool containing the user identities, and then configuring the API methods to enforce this authorization setting.
Adım Adım Çözüm
Anahtar Kavram
API Gateway Cognito User Pools Authorizer configuration