Amazon Cognito
User pools authenticate app users and issue tokens. Identity pools exchange identities for temporary AWS credentials.
Legacy
Short cheat sheet. The full exam treatment is Amazon Cognito.
Cognito is customer identity for web and mobile apps. A user pool is a directory plus token issuer. An identity pool swaps a token for temporary AWS credentials. User pools are created in one Region and store profile data there.
User pools vs identity pools
| User pool | Identity pool | |
|---|---|---|
| Purpose | Sign-up, sign-in, user directory, OIDC issuer | Authorize access to AWS services |
| Output | ID, access and refresh tokens (JWT) | Temporary AWS credentials via STS |
| Identity sources | Local users, social, SAML, OIDC | User pools, social, OIDC, SAML, developer-authenticated, guests |
| Permissions | Groups can map to IAM roles | IAM roles for authenticated and unauthenticated users |
| Guests | No | Yes, unauthenticated identities |
Features that matter
| Feature | Fact |
|---|---|
| API Gateway | Authorizer validates user pool tokens before the backend runs. |
| Lambda triggers | Hook sign-up, confirmation, authentication, pre token generation, custom auth challenge. Invoked synchronously. |
| MFA | SMS or TOTP, and email codes on Essentials and Plus. SMS is sent through SNS, so SNS cost applies. |
| Feature plans | Lite, Essentials (default for new pools), Plus. |
| Threat protection | Compromised credential checks, risky sign-in detection and activity logs need the Plus plan. |
| WAF | A web ACL can be associated directly with a user pool. |
Legacy
Older material calls Plus features "advanced security features" and describes Cognito Sync for cross-device data. Sync is an older feature, so expect AppSync or app code in newer designs.
Exam signal
"Sign in users with Google or SAML and get tokens for API Gateway" is a user pool. "Let mobile users upload straight to S3" or "guest access to a bucket" is an identity pool. The web identity exchange behind it is AssumeRoleWithWebIdentity.
Exam trap
A user pool alone never hands out AWS credentials. Without an identity pool the app cannot call S3 or DynamoDB directly with those tokens.