An online learning platform uses Amazon API Gateway to expose a REST API that delivers course catalog data. The platform needs to restrict access to this API so that only users who have registered and authenticated through the platform's Amazon Cognito User Pool can retrieve the catalog. The development team wants to implement this security control with the minimum amount of custom code and operational overhead.
Which configuration should the developer implement to secure the REST API?
- Configure an API Gateway Cognito User Pools authorizer on the REST API methods, using the user pool's token for authorization.Answer
- BConfigure an API Gateway Lambda authorizer that calls Cognito Identity Pools to obtain temporary AWS credentials for each user request.
- CDeploy an API Gateway Lambda authorizer that validates the Cognito JWT token by downloading the JSON Web Key Set (JWKS) and programmatically verifying the signature.
- DEnable Lambda Proxy Integration on the API Gateway resource and write custom JWT verification logic inside the backend Lambda function.
Answer
Configure an API Gateway Cognito User Pools authorizer on the REST API methods, using the user pool's token for authorization.
The correct option is the one that configures a native Cognito User Pools authorizer. Amazon API Gateway has built-in integration to validate JSON Web Tokens (JWTs) generated by Amazon Cognito User Pools. This native feature requires zero custom code, provides automatic validation, and handles unauthorized requests at the API Gateway layer before invoking any backend integration, meeting all requirements with the lowest operational overhead.
Step-by-Step Solution
Key Concept
API Gateway Cognito User Pools Authorizer
Estimated Time:1m 0s