Soru

Zorluk: KolayAPI Gateway Security and Authorization

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?

  1. An Amazon Cognito User Pools authorizerCevap
  2. B
    An Amazon Cognito Identity Pools authorizer
  3. C
    A Lambda custom authorizer with token verification
  4. D
    A 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

1
Identify the authentication source and token type.
The application uses Amazon Cognito for user authentication and receives JWTs.
This narrows the choices down to Cognito-integrated methods.
2
Evaluate the operational overhead and custom code requirement.
Amazon API Gateway offers a built-in Cognito User Pools authorizer that directly validates JWTs without requiring custom code.
This rules out a Lambda authorizer, which requires custom verification code, and Cognito Identity Pools, which are for AWS credential vending.

Anahtar Kavram

Amazon API Gateway Cognito User Pools Authorizer
Tahmini Süre:45s
Bu soruyu puanla