Soru

Zorluk: KolayAPI Gateway Security and Authorization

A developer is building a smart-home mobile application that connects to a backend hosted on Amazon API Gateway. Users authenticate with the application through an Amazon Cognito User Pool, which provides a JSON Web Token (JWT) upon login. The developer needs to secure the API Gateway REST API by verifying these JWTs before forwarding requests to the backend services.

Which of the following is the most operationally efficient method to authorize API requests using these JWTs?

  1. A
    Configure an Amazon Cognito Identity Pool authorizer on the Amazon API Gateway REST API.
  2. Configure a built-in Amazon Cognito User Pool authorizer on the Amazon API Gateway REST API.Cevap
  3. C
    Create a custom Amazon Lambda authorizer to decode and validate the Cognito JWTs.
  4. D
    Enable Amazon Lambda Proxy integration on Amazon API Gateway to validate the Cognito JWTs within the backend Lambda function.

Cevap

Configure a built-in Amazon Cognito User Pool authorizer on the Amazon API Gateway REST API.
The correct option is to configure a built-in Amazon Cognito User Pool authorizer. API Gateway natively integrates with Cognito User Pools to validate JWT identity tokens without requiring custom code or additional Lambda invocations, making it the most operationally efficient choice.

Adım Adım Çözüm

1
Identify the token type and authentication provider.
The tokens are JWTs generated by an Amazon Cognito User Pool.
Determining the identity source is the first step in selecting the appropriate authorizer.
2
Evaluate native API Gateway features for the identity provider.
API Gateway provides a native Amazon Cognito User Pool authorizer to validate these JWTs.
Using built-in features reduces operational complexity and costs.
3
Configure the API Gateway authorizer.
The authorizer validates the token header natively before forwarding requests, blocking unauthorized access at the edge.
This secures the API boundary with the least administrative overhead.

Anahtar Kavram

API Gateway built-in Cognito User Pool Authorizers
Bu soruyu puanla