Question

Difficulty: EasyAmazon Cognito Authentication and Authorization

To support file uploads in a new collaborative web portal, users must be able to sign up, sign in, and directly upload files to a private Amazon S3 bucket. The application needs to authenticate users and then obtain temporary AWS credentials for the uploads. Which TWO Amazon Cognito components should the developer implement to meet these requirements?

  1. A User Pool to manage user registration, sign-in, and provide a user directory.Answer
  2. An Identity Pool to exchange authentication tokens for temporary AWS credentials to access Amazon S3.Answer
  3. C
    An IAM user with programmatic access keys stored directly in the web application's frontend code.
  4. D
    An API Gateway Lambda Authorizer to generate AWS credentials for S3 uploads.
  5. E
    An Identity Pool to store user profiles, passwords, and handle email verification workflows.

Answer

The developer should implement a Cognito User Pool to manage user registration and sign-in, and a Cognito Identity Pool to exchange the authentication tokens for temporary AWS credentials to access Amazon S3.
To support the user registration, authentication, and S3 file uploads, both User Pools and Identity Pools are needed. A Cognito User Pool manages the user directory, sign-up, and sign-in processes (authentication). Once authenticated, a Cognito Identity Pool exchanges the resulting token for temporary AWS credentials (authorization) that the application's frontend can use to upload files directly to Amazon S3.

Step-by-Step Solution

1
Identify the authentication and directory management component.
Amazon Cognito User Pool.
User Pools serve as the user directory and handle user registration, sign-in, and identity tokens.
2
Identify the authorization component for accessing AWS resources.
Amazon Cognito Identity Pool.
Identity Pools exchange authentication tokens for temporary AWS credentials (via AWS STS) allowing client-side applications to access services like Amazon S3 directly.

Key Concept

Distinction between Amazon Cognito User Pools (authentication and user directory) and Identity Pools (authorization and temporary AWS credentials for AWS resources).
Rate this question