Question

Difficulty: EasyApplication Authentication and Authorization with Amazon Cognito

A developer is designing a new web application where users must register and log in. Once authenticated, the application needs to retrieve temporary AWS credentials to allow the client-side code to download user-specific files directly from an Amazon S3 bucket.

Which two Amazon Cognito features should be configured to meet these requirements? (Select TWO.)

  1. An Amazon Cognito user pool to handle user registration, sign-in, and profile management.Answer
  2. An Amazon Cognito identity pool to exchange authentication tokens for temporary AWS credentials.Answer
  3. C
    An Amazon API Gateway Lambda authorizer to generate and return temporary AWS Security Token Service (STS) credentials.
  4. D
    An IAM trust policy applied directly to the user pool client to authorize read access to Amazon S3.
  5. E
    An Amazon Cognito user pool client configured with an inline IAM policy to delegate access keys directly to the client browser.

Answer

Configure an Amazon Cognito user pool for user registration, authentication, and sign-in, and an Amazon Cognito identity pool to exchange authentication tokens for temporary AWS credentials.
To build this solution, the developer must configure an Amazon Cognito user pool for authentication (user registration and sign-in) and an Amazon Cognito identity pool for authorization (exchanging user pool tokens for temporary AWS credentials to access S3).

Step-by-Step Solution

1
Determine the service needed for user authentication, registration, and directory management.
Identify that Amazon Cognito user pools act as the identity provider to authenticate users and manage their profiles.
User pools are specifically designed to handle authentication flows, sign-ups, and password management.
2
Determine how to authorize authenticated users to access AWS resources like Amazon S3 directly from the client.
Identify that Amazon Cognito identity pools are required to exchange the user pool token for temporary AWS credentials.
Identity pools map authenticated users to IAM roles, granting temporary, limited-privilege credentials via AWS STS.

Key Concept

Distinction between authentication (Cognito User Pools) and authorization/temporary credentials (Cognito Identity Pools)
Rate this question