A developer is building a new web application that allows users to sign up, sign in, and download files directly from a private Amazon S3 bucket. The application must handle user directory management and authenticate users before granting them temporary access to S3. Which two Amazon Cognito resources should the developer configure to satisfy these authentication and authorization requirements?
- A Cognito User Pool to manage user registration, authentication, and the user directory.Answer
- A Cognito Identity Pool to exchange authentication tokens for temporary AWS credentials to access S3.Answer
- CA Cognito User Pool to directly generate temporary IAM credentials for accessing the Amazon S3 bucket.
- DA Cognito Identity Pool to store user profiles and handle password recovery emails.
- EA custom API Gateway Lambda Authorizer to validate Cognito tokens and generate AWS STS temporary credentials for client S3 access.
Answer
To meet the requirements, the developer must configure a Cognito User Pool to handle user directory management and authentication, and a Cognito Identity Pool to authorize access and provide temporary AWS credentials for the S3 bucket.
The correct solution involves configuring both a Cognito User Pool and a Cognito Identity Pool. The User Pool manages user directory services (registration, login, password recovery), and the Identity Pool handles authorization by exchanging the authenticated user's tokens for temporary AWS IAM credentials so the application can access the S3 bucket directly.
Step-by-Step Solution
Key Concept
Separation of concerns between Cognito User Pools (authentication/directory) and Cognito Identity Pools (authorization/AWS credentials).
Estimated Time:1m 0s