A company is building a mobile travel application where users authenticate via a client interface and receive a JSON Web Token (JWT). The application's backend services are exposed through an Amazon API Gateway REST API. The developer needs to secure the API endpoints so that only authenticated users can access them, verifying the JWT signature on each request. Which of the following is the most operationally efficient method to implement this security requirement with the least development effort?
- Configure a Cognito User Pools authorizer on the API Gateway method to validate the incoming tokens automatically.Cevap
- BConfigure a Cognito Identity Pools authorizer on the API Gateway method to validate the incoming tokens automatically.
- CCreate a custom Lambda authorizer that parses, validates, and verifies the incoming JSON Web Token signature on each request.
- DImplement custom token verification logic directly within the backend Lambda function using a Lambda Proxy integration.
Cevap
Configure a Cognito User Pools authorizer on the API Gateway method to validate the incoming tokens automatically.
Using a Cognito User Pools authorizer is the most operationally efficient approach. It leverages API Gateway's built-in capability to automatically validate incoming JSON Web Tokens (JWTs) without requiring custom code or additional Lambda executions for validation, lowering development effort and ongoing maintenance.
Adım Adım Çözüm
Anahtar Kavram
Amazon API Gateway Cognito User Pools Authorizer
Tahmini Süre:1m 30s