Skip to Content
Asterrr's Handbook
Service cheat sheetsSecurity and identity cheat sheets

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.

sign infederateJWTID tokentemp credentialsMobile or webappSocial, SAML,OIDC IdPUser poolAPI GatewayIdentity poolS3 or DynamoDB
The user pool authenticates and returns JWTs. The identity pool trades a token for STS credentials that reach AWS services.

User pools vs identity pools

User poolIdentity pool
PurposeSign-up, sign-in, user directory, OIDC issuerAuthorize access to AWS services
OutputID, access and refresh tokens (JWT)Temporary AWS credentials via STS
Identity sourcesLocal users, social, SAML, OIDCUser pools, social, OIDC, SAML, developer-authenticated, guests
PermissionsGroups can map to IAM rolesIAM roles for authenticated and unauthenticated users
GuestsNoYes, unauthenticated identities

Features that matter

FeatureFact
API GatewayAuthorizer validates user pool tokens before the backend runs.
Lambda triggersHook sign-up, confirmation, authentication, pre token generation, custom auth challenge. Invoked synchronously.
MFASMS or TOTP, and email codes on Essentials and Plus. SMS is sent through SNS, so SNS cost applies.
Feature plansLite, Essentials (default for new pools), Plus.
Threat protectionCompromised credential checks, risky sign-in detection and activity logs need the Plus plan.
WAFA 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.

IAM fundamentals, AWS WAF

Further reading

On this page