Security, Identity, and Compliance
Amazon Cognito
On the radar· Amazon Cognito Sync no longer accepts new customersIdentity platform for web and mobile applications: user pools sign up and authenticate users (including through Google, Apple, or SAML and OIDC providers) and issue JWTs. Identity pools exchange those tokens for temporary AWS credentials to access services such as Amazon S3 or Amazon DynamoDB.
Exam phrases that point here
«user sign-up and sign-in for a web or mobile application»
An Amazon Cognito user pool is a managed user directory: it handles sign-up, sign-in, email or phone verification, and MFA.
When not: If the people signing in are employees accessing AWS accounts, the clue points to IAM Identity Center. Cognito is for an application's customers or end users.
«sign in with Google, Facebook, or Apple»
Cognito supports social providers and SAML or OpenID Connect providers, so the application does not have to integrate each one on its own.
When not: If sign-in with an IdP is for employees to access the AWS Management Console, the answer is IAM Identity Center or IAM federation, not Cognito.
«give mobile app users direct, temporary access to S3 or DynamoDB»
An identity pool exchanges the user's identity (from a user pool, a social provider, or a guest) for temporary AWS credentials tied to an IAM role.
When not: If the application only calls its own API and does not touch AWS services directly, the user pool token and an API Gateway authorizer are enough, with no identity pool.
«allow guest access without signing in»
Identity pools can give credentials to unauthenticated users, with a different, more limited IAM role than the one for authenticated users.
When not: Guest access is for using AWS resources from the app. If the goal is to serve public content, such as images or pages, Amazon S3 and Amazon CloudFront are usually enough.
«protect an API Gateway API so that only registered users can call it»
API Gateway has a Cognito user pool authorizer: it checks the token the client sends and lets through only calls with a valid token.
When not: If the caller is another AWS service or an application with IAM credentials, IAM authorization is used. If you need custom logic to validate a token from another provider, a Lambda authorizer is used.
Often paired with
- Amazon API Gateway
- Amazon DynamoDB
- Amazon S3