A developer is building a mobile application that uses Amazon Cognito for user authentication. The backend is exposed through an Amazon API Gateway REST API. The developer needs to secure the API so that only authenticated users can access the endpoints. The authentication mechanism must validate JSON Web Tokens (JWTs) issued by Cognito, require no custom authorizer code, and introduce minimal latency. Which API Gateway authorization method should the developer implement?
- An Amazon Cognito User Pools authorizerCevap
- BAn Amazon Cognito Identity Pools authorizer
- CA Lambda custom authorizer with token verification
- DA Lambda proxy integration with manual token parsing
Cevap
An Amazon Cognito User Pools authorizer
The correct answer is the Amazon Cognito User Pools authorizer. API Gateway provides built-in integration with Cognito User Pools to validate identity tokens (IDs) or access tokens returned from Cognito. This requires no custom coding, operates at the API Gateway level to block unauthorized requests, and minimizes overhead.
Adım Adım Çözüm
Anahtar Kavram
Amazon API Gateway Cognito User Pools Authorizer
Tahmini Süre:45s