Soru

Zorluk: KolayAPI Gateway Security and Authorization

A developer is building a REST API using Amazon API Gateway and wants to restrict access to authenticated users from a specific Amazon Cognito User Pool. The developer wants to use the built-in integration features of API Gateway without writing custom code for authentication validation. Which two actions must the developer perform to configure a Cognito User Pools authorizer for the API? (Select two.)

  1. Create a Cognito User Pool authorizer in API Gateway and configure it with the Cognito User Pool details.Cevap
  2. Configure the API Gateway resource method to use the newly created Cognito User Pool authorizer.Cevap
  3. C
    Create a Cognito Identity Pool authorizer in API Gateway and configure it with the Identity Pool ID.
  4. D
    Create a custom Lambda authorizer that manually decodes and verifies the Cognito User Pool identity tokens.
  5. E
    Configure a Lambda integration in proxy mode so that the backend function handles Cognito client verification.

Cevap

To configure a Cognito User Pools authorizer, the developer must create the Cognito User Pool authorizer in API Gateway and then configure the API method to use that authorizer.
To secure the API using Cognito User Pools natively, the developer needs to create a Cognito User Pool authorizer in API Gateway and then assign that authorizer to the respective resource methods. This offloads authentication from backend integrations to API Gateway.

Adım Adım Çözüm

1
Set up the authorizer in API Gateway.
A Cognito User Pool authorizer is created and pointed to the appropriate User Pool.
This establishes the validation source for the incoming JWT tokens without requiring custom code.
2
Associate the authorizer with the API resource method.
The target HTTP method on the resource is configured to require authentication via the new authorizer.
This ensures that API Gateway blocks unauthorized requests before they reach the backend integration.

Anahtar Kavram

API Gateway Cognito User Pools Authorizer
Tahmini Süre:1m 0s
Bu soruyu puanla