Soru

Zorluk: KolayAPI Gateway Security and Authorization

A developer is configuring security for a new REST API in Amazon API Gateway. The API must restrict access to only those clients who authenticate via an Amazon Cognito User Pool. Which of the following steps must the developer perform to implement this authorization? (Select TWO.)

  1. Create an Amazon Cognito User Pool authorizer in the API Gateway console.Cevap
  2. Configure the API methods to use the Cognito User Pool authorizer in the Method Request settings.Cevap
  3. C
    Create a custom Lambda authorizer to manually decode and validate the JSON Web Tokens (JWTs) from the Cognito User Pool.
  4. D
    Configure an Amazon Cognito Identity Pool to authenticate users and generate temporary AWS IAM credentials for API Gateway.
  5. E
    Enable Lambda proxy integration and implement JWT validation logic inside the backend AWS Lambda function.

Cevap

To configure authorization via a Cognito User Pool, the developer must create a Cognito User Pool authorizer in API Gateway and update the Method Request settings of the API methods to use this authorizer.
To authenticate API clients against an Amazon Cognito User Pool natively, the developer must first define a Cognito User Pool authorizer at the API Gateway level. Once the authorizer is defined, the developer must configure the specific REST API methods to use this authorizer under Method Request settings, ensuring that incoming requests are automatically validated.

Adım Adım Çözüm

1
Create the Amazon Cognito User Pool authorizer.
The authorizer is successfully configured and linked to the target Amazon Cognito User Pool.
This registers the User Pool with API Gateway so it can perform token verification.
2
Update the API method settings.
The method's authorization is set to the newly created Cognito authorizer.
This ensures that API Gateway actively protects the method, requiring clients to provide a valid token.

Anahtar Kavram

Amazon API Gateway Cognito User Pool Authorizer
Bu soruyu puanla