A developer is configuring security for an Amazon API Gateway REST API that serves a client web portal. The portal users authenticate using an external, non-AWS identity provider that issues JSON Web Tokens (JWT). The developer wants to validate these tokens at the API Gateway boundary before requests are forwarded to a backend integration. Which API Gateway authorization method should the developer use to validate the tokens with the least operational complexity?
- Configure a Lambda authorizer to validate the JWT directly against the external identity provider's public keys.Answer
- BConfigure an Amazon Cognito User Pool authorizer to validate the third-party JWT directly at the API Gateway level.
- CConfigure an Amazon Cognito Identity Pool authorizer to validate the JWT and generate temporary AWS credentials to sign the request.
- DConfigure a Lambda proxy integration and perform token validation inside the backend integration Lambda function.
Answer
Configure a Lambda authorizer to validate the JWT directly against the external identity provider's public keys.
Configuring a Lambda authorizer allows API Gateway to call a custom Lambda function to validate bearer tokens (like JWTs) issued by any third-party identity provider. The function verifies the token signature against the provider's public keys and returns an IAM policy to allow or deny the request, securing the API at the boundary.
Step-by-Step Solution
Key Concept
API Gateway Lambda Authorizers for external identity providers
Estimated Time:1m 30s