Amazon Cognito Authentication and Authorization
71 questions
An enterprise web application requires users to sign in using their corporate Identity Provider (IdP) via SAML 2.0. After successful authentication, the web application must access tenant-specific folders in an Amazon S3 bucket directly from the browser. Additionally, the application must make authorized calls to a backend REST API hosted on Amazon API Gateway. The developer wants to minimize custom coding for token validation and credential exchange. Which architecture configuration satisfies these requirements with the least operational overhead?
A developer is building a web application that stores user-specific files in a private Amazon S3 bucket. The application uses an Amazon Cognito User Pool for user authentication. The developer wants to authorize users to access their department's files in S3 using temporary AWS credentials. The user's department is stored in a custom attribute named custom:department in the User Pool. The developer has created a separate IAM role for each department. Which approach should the developer use to assign the correct IAM role to each user with the least operational overhead?
A developer is building a single-page web application (SPA) that will allow users to authenticate using Amazon Cognito User Pools and access backend services through Amazon API Gateway. Since the SPA runs entirely in the user's browser, the client credentials cannot be kept secure. The developer wants to implement a secure authentication flow using the authorization code grant with Proof Key for Code Exchange (PKCE) and validate access at the API Gateway layer. Which TWO steps should the developer take to implement this architecture?
Select all that apply
A developer is implementing a smart home mobile application. The mobile client needs to authenticate users and obtain temporary, limited-privilege AWS credentials to publish telemetry data directly to Amazon IoT Core MQTT topics.
Which solution meets these requirements with the least operational overhead?
A developer is building a serverless web application that allows users to access corporate resources through a backend REST API hosted on Amazon API Gateway and powered by AWS Lambda. The developer has configured an Amazon Cognito User Pool to handle user authentication. The developer needs to secure the API Gateway endpoints so that only authenticated users can access them, and the backend Lambda function must retrieve the authenticated user's email address to record audit logs. The solution must minimize custom code and operational overhead.
Which two actions should the developer take to meet these requirements?
Select all that apply
A company is creating a customer portal where registered users can log in and view their monthly account statements. These statements are stored in a private Amazon S3 bucket. The developer needs to implement a solution that authenticates users, manages their accounts, and provides them with temporary, limited-privilege AWS credentials to download their statements directly from S3.
Which Amazon Cognito configuration should the developer use to meet these requirements?
A developer is building an enterprise web application. The application must authenticate corporate users using an external SAML 2.0 Identity Provider (IdP) and provide them with access to two resources: a secure REST API hosted on Amazon API Gateway, and a private Amazon S3 bucket for uploading reports directly from the client.
Which TWO configurations are required to meet these requirements? (Select TWO.)
Select all that apply
A developer is building a web application where users sign in via social identity providers. The application needs to call a backend REST API on Amazon API Gateway, and also allow users to upload user profile photos directly to a private Amazon S3 bucket.
Which Cognito configuration meets these requirements with the least operational overhead?
A developer is designing a collaborative document editing web application. The application authenticates users using an Amazon Cognito User Pool. The backend APIs are hosted on Amazon API Gateway. The developer wants to restrict access to a specific API Gateway resource method (POST /documents) so that only users belonging to the 'Editors' Cognito User Pool group can invoke it.
Which TWO configurations would allow the developer to implement this group-based authorization?
Select all that apply
A developer is building a command-line interface (CLI) tool that internal engineers will use to upload software builds directly to a private Amazon S3 bucket. The engineers authenticate with the company's external OpenID Connect (OIDC) identity provider. The CLI tool needs to obtain temporary AWS credentials to write to the S3 bucket directly.
Which solution meets these requirements with the least operational overhead?
A developer is building a serverless mobile application for fitness tracking. The application needs to authenticate users using an external OpenID Connect (OIDC) identity provider. Once authenticated, the application must allow users to call an Amazon API Gateway REST API and upload workout logs directly to their own private folders in an Amazon S3 bucket. Which TWO configurations should the developer implement to meet these requirements?
Select all that apply
A software engineer is configuring security for a web application where clients send requests to a REST API hosted on Amazon API Gateway. The application uses an Amazon Cognito User Pool for user authentication. The engineer must restrict access to the REST API so that only authenticated users with a valid JSON Web Token (JWT) can call the endpoints, without writing custom code to decode or validate the tokens. Which solution meets these requirements with the least operational overhead?
A developer is implementing a secure report retrieval feature for a corporate intranet portal. The portal's users authenticate using an Amazon Cognito User Pool. Once authenticated, the portal's client-side application needs to download private reports directly from an Amazon S3 bucket. To optimize performance and cost, the architecture must not route the file downloads through an intermediate API Gateway or Lambda function. The solution must grant users direct, short-lived access to the reports using the least privilege principle.
Which TWO configuration steps should the developer perform to meet these requirements?
Select all that apply
A developer is designing a web application that uses Amazon Cognito User Pools for user authentication and Amazon API Gateway REST APIs for the backend. The API endpoints must be secured so that only users with an 'Active' subscription can access them. The subscription status is stored in an external Amazon DynamoDB table and updated in real-time, which prevents it from being stored as a static attribute in the Cognito ID or access tokens. Which solution should the developer implement to secure the API Gateway endpoints?
An IoT startup is developing a dashboard web application that allows users to authenticate using external social providers (Google and Apple) via Amazon Cognito. Once authenticated, the web application must interact with two backend systems:
1. Make authenticated requests to an Amazon API Gateway HTTP API that manages dashboard configurations.
2. Directly publish sensor telemetry data to an Amazon Kinesis Data Stream.
Which TWO configurations must the developer implement to secure access to these resources? (Select TWO.)
Select all that apply
A developer is building a corporate portal where employees must sign in using their existing SAML 2.0 Identity Provider (IdP) credentials. The portal's backend API, hosted on Amazon API Gateway, requires custom user claims such as department and employee ID to perform fine-grained authorization. Which configuration will meet these requirements with the least development effort?
A developer is building a mobile gaming application that requires authenticated users to save their game progress files directly to an Amazon S3 bucket. The game progress files must be stored in a folder path specific to each user. Additionally, the application needs to call a secure REST API hosted on Amazon API Gateway to post high scores. The developer wants to use Amazon Cognito for authentication and authorization with the least operational overhead.
Which TWO configurations must the developer implement to meet these requirements?
Select all that apply
A developer is building a serverless web application that utilizes Amazon Cognito User Pools for user authentication and Amazon API Gateway REST APIs for backend services. The developer needs to secure the API Gateway endpoints so that only authenticated users can access them. The solution must validate the JSON Web Tokens (JWTs) provided by the client with the least amount of custom code and lowest operational overhead. Which solution should the developer implement to meet these requirements?
A company is developing a mobile application that allows users to sign in using their enterprise SAML identity provider. After successful authentication, the mobile application needs to upload user-specific profile images directly to an Amazon S3 bucket, and make secure API calls to a backend REST API hosted on Amazon API Gateway. Which TWO configurations must the developer implement to meet these requirements?
Select all that apply
A developer is designing a single-page web application where users sign in with their email address and password. After authentication, the application must be able to call a secure backend REST API hosted on Amazon API Gateway and download user-specific profile images directly from a private Amazon S3 bucket. Which two actions should the developer take to meet these requirements with the least operational overhead?
Select all that apply