A developer is building a client-facing web application and needs to restrict access to a REST API hosted on Amazon API Gateway. The application's users will sign in using an Amazon Cognito User Pool. The developer wants to secure the API Gateway endpoints by validating the identity tokens issued to users upon login, with the least amount of development effort and custom code. Which authorization method should the developer configure on the API Gateway resources?
- Configure a built-in Amazon Cognito User Pools authorizer on the API Gateway resources.Cevap
- BCreate a custom Lambda authorizer to parse and validate the JSON Web Token (JWT) issued by the User Pool.
- CConfigure an Amazon Cognito Identity Pool authorizer to directly authenticate the API Gateway request.
- DConfigure a Lambda proxy integration to manually inspect the user credentials in the incoming request body.
Cevap
Configure a built-in Amazon Cognito User Pools authorizer on the API Gateway resources.
Using the built-in Amazon Cognito User Pools authorizer is the most efficient method because Amazon API Gateway natively validates tokens issued by Amazon Cognito. This eliminates the need to develop, test, and maintain custom Lambda authorizer code, which minimizes development effort and operational overhead.
Adım Adım Çözüm
Anahtar Kavram
Built-in Cognito User Pools Authorizer in Amazon API Gateway