Cognito User Pools
User pools, app clients, MFA, identity providers, full authentication flows.
fakecloud implements 122 of 122 Cognito User Pools operations at 100% Smithy conformance.
Supported features
- User pools — CRUD, password policies, attribute configuration, account recovery, email/SMS configuration
- App clients — CRUD, OAuth flows, token validity, supported identity providers
- Users — admin create/delete/update, self-signup, group membership
- Groups — CRUD, user membership, precedence
- MFA — SMS, TOTP, software token setup/verification
- WebAuthn — passkey registration and assertion, with real
packed-format attestation parsing (AAGUID, certificate chain summary, signature counter) and verification at registration - Identity providers — SAML, OIDC, social
- Resource servers — CRUD, custom scopes
- Domains — user pool domains
- Authentication flows — USER_PASSWORD_AUTH, USER_SRP_AUTH, REFRESH_TOKEN_AUTH, CUSTOM_AUTH, ADMIN_USER_PASSWORD_AUTH
- Password management — ChangePassword, ForgotPassword, ConfirmForgotPassword
- Confirmation codes — email/SMS confirmation flows
- Devices — Confirm, update, forget, track
- Tokens — access, refresh, ID tokens with real JWT structure. The
PreTokenGenerationtrigger'sclaimsOverrideDetails(claims to add/suppress and group overrides) is merged into the issued access and ID tokens before signing - Compromised credentials —
CompromisedCredentialsRiskConfigurationwithActions.EventAction = BLOCKrejectsSignUp/AdminInitiateAuthwhen the supplied password's SHA-256 hash is in the configured compromised set - Signing keys —
GetSigningCertificatereturns a real, parseable X.509 certificate that wraps the pool's RSA-2048 signing key (same key served via JWKS), matching the AWS response shape - Auth events — sign-up, sign-in, failures, password changes
Protocol
JSON protocol. X-Amz-Target header, JSON body, JSON responses.
OAuth2 / OIDC endpoints
GET /oauth2/authorize— Hosted UI authorization endpoint. Supportsresponse_type=code(Authorization Code grant, with optional PKCES256/plain) andresponse_type=token(Implicit grant). Validatesclient_id,redirect_uri(must match the client'sCallbackURLs), andscope(must be a subset ofAllowedOAuthScopes). For scripted tests, acceptsusername/passwordquery params in lieu of the real Cognito Hosted UI HTML form.POST /oauth2/token— token endpoint withauthorization_code,client_credentials, andrefresh_tokengrants. RFC 6749 §2.3.1 Basic auth supported. PKCE (S256/plain) verified forauthorization_code.PreTokenGenerationclaimsOverrideDetailsare merged into the access and ID tokens before signing.GET|POST /oauth2/userInfo— RFC 7662 user info (bearer access token -> standard OIDC claims).POST /oauth2/revoke— RFC 7009 token revocation.GET /<pool_id>/.well-known/jwks.json— RS256 public key for token verification.GET /<pool_id>/.well-known/openid-configuration— OIDC discovery document.
Introspection
GET /_fakecloud/cognito/confirmation-codes— list all pending confirmation codes across poolsGET /_fakecloud/cognito/confirmation-codes/{pool_id}/{username}— codes for a specific userPOST /_fakecloud/cognito/confirm-user— force-confirm a user without the email/SMS flowGET /_fakecloud/cognito/tokens— list active tokens (without exposing strings)POST /_fakecloud/cognito/expire-tokens— expire tokens for a pool/userGET /_fakecloud/cognito/auth-events— list auth events (signup, signin, failures)POST /_fakecloud/cognito/authorization-codes— mint a single-use OAuth2 authorization code for theauthorization_codegrant (programmatic alternative to driving/oauth2/authorize)POST /_fakecloud/cognito/compromised-passwords— register plaintext passwords as compromised; each is SHA-256 hashed server-side and added to the per-account set checked byCompromisedCredentialsRiskConfigurationenforcementGET /_fakecloud/cognito/webauthn-credentials— list registered WebAuthn credentials with parsedpacked-attestation info (AAGUID, certificate chain summary, signature counter)GET /_fakecloud/cognito/pretokengen/invocations— list PreTokenGeneration Lambda trigger invocations recorded byInitiateAuth, with full request/response payloads plus pre-parsedclaims_added,claims_overridden, andgroup_overridesso tests can assert claim mutation flows without inspecting the issued JWT
Cross-service delivery
- Cognito -> Lambda — All 12 triggers: PreSignUp, PostConfirmation, PreAuthentication, PostAuthentication, CustomMessage, PreTokenGeneration, UserMigration, DefineAuthChallenge, CreateAuthChallenge, VerifyAuthChallengeResponse, CustomEmailSender, CustomSMSSender
- Cognito -> SES — Verification emails generated by
SignUp/ResendConfirmationCode/ForgotPassword/GetUserAttributeVerificationCode(email attribute) are dispatched through SES and visible at/_fakecloud/ses/emails - Cognito -> SNS — SMS verification codes generated by
GetUserAttributeVerificationCode(phone attribute) are dispatched through SNS and visible at/_fakecloud/sns/sms - CustomEmailSender / CustomSMSSender precedence — When configured on the user pool, the Lambda is invoked instead of going through SES/SNS, matching AWS behavior
Why this matters
LocalStack only offers Cognito behind a paid tier. fakecloud implements the full user pool surface free and open-source, with real JWT issuance, real auth flows, and introspection for the confirmation-code / token state that makes testing auth flows feasible end-to-end.