A developer is designing a cross-platform client application that requires user sign-up, sign-in, and group-based access control. The backend services are hosted on Amazon ECS tasks running behind an Application Load Balancer (ALB). The developer wants to authenticate users and offload the verification of authentication tokens from the ECS tasks to the ALB. Which of the following configurations must the developer implement to meet these requirements? (Select TWO.)
- Configure an Amazon Cognito User Pool to manage user registration, sign-in, and group membership.Answer
- Configure a listener rule on the Application Load Balancer with an authenticate-cognito action to validate user tokens and forward user claims to the target group.Answer
- CConfigure an Amazon Cognito Identity Pool to authenticate the users and generate temporary AWS credentials to authorize the Application Load Balancer listener.
- DDeploy an AWS Lambda function as a custom authorizer on the Application Load Balancer to decode and validate the Cognito user tokens manually.
- EModify the IAM trust policy of the Amazon ECS Task Execution Role to allow the Cognito User Pool service principal to assume the role.
Answer
Configure an Amazon Cognito User Pool to manage user registration, sign-in, and group membership, and configure a listener rule on the Application Load Balancer with an authenticate-cognito action to validate user tokens and forward user claims to the target group.
To authenticate application users and offload token verification from Amazon ECS tasks to the Application Load Balancer, the developer must set up an Amazon Cognito User Pool for managing identities and configure the ALB listener rule to authenticate requests using Cognito. The ALB handles the authentication flow with the User Pool natively and forwards the user information in headers, securing the backend application without custom authentication logic.
Step-by-Step Solution
Key Concept
Offloading user authentication and validation to an Application Load Balancer using Amazon Cognito User Pools.