A mobile application authenticates users through an external OpenID Connect provider and must upload directly to a private S3 bucket using temporary AWS credentials. Each user must access only the S3 prefix named for that user's federated identity, with no backend proxy or individual IAM users. Which design meets these requirements?
Show the answer
Correct answerB. Use a Cognito identity pool and scope its role policy to each user's identity ID prefix.
AWhy not this: A shared long-term key violates the temporary-credential requirement and cannot enforce isolation through client-side checks.
BWhy this is right: The identity pool provides temporary credentials, and an identity-based prefix condition enforces per-user S3 access.
CWhy not this: User pool ID tokens are not AWS credentials that S3 accepts to authorize direct uploads.
DWhy not this: Temporary credentials alone do not isolate users when the role permits access to every user's prefix.
A Cognito identity pool exchanges supported identity-provider tokens for temporary AWS credentials. An identity-aware IAM policy can restrict those credentials to the user's prefix; a shared authenticated role with unrestricted prefix access does not enforce user isolation.