Question

Difficulty: MediumApplication Authentication and Authorization with Amazon Cognito

A team is migrating an on-premises desktop application to a cloud-native model. The application requires users to authenticate against a central directory and then obtain temporary, limited-privilege AWS credentials to retrieve configuration objects directly from an Amazon DynamoDB table. Which configuration steps must the team implement to meet these requirements? (Select TWO.)

  1. Configure a user pool in Amazon Cognito to manage the user directory and handle user authentication.Answer
  2. Configure an identity pool in Amazon Cognito, link it to the user pool, and define an authenticated IAM role that allows DynamoDB access.Answer
  3. C
    Configure a user pool in Amazon Cognito to vend temporary AWS credentials directly to the application, and use an identity pool to maintain the user directory.
  4. D
    Create an Amazon API Gateway Lambda authorizer to authenticate users and generate temporary AWS credentials to access the DynamoDB table.
  5. E
    Configure an IAM role with a trust policy that trusts the DynamoDB service principal, allowing the desktop application to assume the role directly.

Answer

Configure a user pool in Amazon Cognito to manage the user directory and handle user authentication, and configure an identity pool in Amazon Cognito, link it to the user pool, and define an authenticated IAM role that allows DynamoDB access.
To meet the requirements, the team must use a user pool in Amazon Cognito to handle user directory management and authentication. Then, they must link this user pool to an Amazon Cognito identity pool, which handles authorization by vending temporary AWS credentials to authenticated users via an IAM role.

Step-by-Step Solution

1
Identify the authentication requirement.
Use a Cognito user pool to act as a user directory and handle user authentication.
User pools are designed for identity management, user directory hosting, and authentication.
2
Identify the authorization requirement for direct AWS resource access.
Use a Cognito identity pool linked to the user pool to exchange identity tokens for temporary AWS credentials.
Identity pools authorize access to AWS resources by vending temporary credentials to authenticated users.
3
Configure the IAM role and trust policy for the identity pool.
Define an authenticated IAM role allowing DynamoDB access and trust the Cognito identity service principal.
This establishes the secure trust relationship needed for Cognito to assume the role on behalf of the user.

Key Concept

Separation of authentication (Cognito User Pools) and authorization (Cognito Identity Pools) for direct AWS resource access using IAM roles.
Rate this question