Question

Difficulty: EasyAmazon Cognito Authentication and Authorization

A developer is building a serverless web application that allows users to sign in and upload files directly to an Amazon S3 bucket. The application must support user registration and sign-in, and provide temporary AWS credentials to authenticated users for S3 uploads. Which two Amazon Cognito features should the developer configure to meet these requirements? (Select TWO.)

  1. Amazon Cognito User Pools to manage user registration, authentication, and directory servicesAnswer
  2. Amazon Cognito Identity Pools to authorize users and obtain temporary AWS credentials for S3 accessAnswer
  3. C
    Amazon Cognito Identity Pools to store user profiles and host the sign-in web interface
  4. D
    Amazon Cognito User Pools to issue temporary AWS IAM credentials directly to the client application
  5. E
    A custom AWS Lambda Authorizer linked with Amazon Cognito to generate temporary AWS credentials

Answer

Amazon Cognito User Pools to manage user registration, authentication, and directory services, and Amazon Cognito Identity Pools to authorize users and obtain temporary AWS credentials for S3 access.
To support user sign-up and authentication, a Cognito User Pool is required. To authorize the users and grant temporary AWS credentials for direct S3 upload access, a Cognito Identity Pool is required.

Step-by-Step Solution

1
Determine the service needed for user authentication and directory management.
Amazon Cognito User Pools provides the directory and authentication features required for user registration and sign-in.
User Pools handle authentication and act as the identity provider.
2
Determine the service needed to access AWS resources directly from the client.
Amazon Cognito Identity Pools (federated identities) allows exchanging authentication tokens for temporary AWS IAM credentials.
Identity Pools manage authorization and provide credentials for AWS resources like Amazon S3.

Key Concept

Cognito User Pools authenticate users and manage directories, while Cognito Identity Pools authorize users to access AWS resources by issuing temporary credentials.
Rate this question