A developer is building a web application where users must register and log in to access the system. The application needs to retrieve files from a private Amazon S3 bucket directly from the client browser and invoke private REST APIs hosted on Amazon API Gateway. Which Amazon Cognito configuration will meet these requirements with the least operational overhead?
- AUse a Cognito User Pool to manage user sign-ups and logins. Use a Cognito Identity Pool to exchange the User Pool tokens for temporary AWS credentials to access Amazon S3, and write a custom API Gateway Lambda Authorizer to manually decode and validate the User Pool JSON Web Tokens (JWTs) to secure the REST APIs.
- BUse a Cognito Identity Pool to manage user sign-ups, logins, and client federation. Use a Cognito User Pool to generate the temporary AWS credentials required for direct Amazon S3 bucket access, and configure an API Gateway Cognito User Pool Authorizer targeting the Identity Pool to secure the REST APIs.
- Use a Cognito User Pool to manage user sign-ups and logins. Use a Cognito Identity Pool to exchange the User Pool tokens for temporary AWS credentials to access Amazon S3, and configure an API Gateway Cognito User Pool Authorizer using the User Pool to secure the REST APIs.Cevap
- DUse a Cognito User Pool to manage user sign-ups and logins, and attach an IAM policy directly to User Pool groups to authorize direct Amazon S3 bucket access. Configure an API Gateway Cognito User Pool Authorizer pointing to the groups to secure the REST APIs.
Cevap
Use a Cognito User Pool to manage user sign-ups and logins. Use a Cognito Identity Pool to exchange the User Pool tokens for temporary AWS credentials to access Amazon S3, and configure an API Gateway Cognito User Pool Authorizer using the User Pool to secure the REST APIs.
The correct option correctly identifies the separation of concerns: using a Cognito User Pool for user authentication, a Cognito Identity Pool to authorize direct AWS resource access (S3) via temporary credentials, and a built-in Cognito User Pool authorizer to protect the API Gateway endpoints. This represents the most operationally efficient architecture.
Adım Adım Çözüm
Anahtar Kavram
Amazon Cognito User Pools vs. Identity Pools, and API Gateway integration.
Tahmini Süre:1m 30s