Migrating from AWS Cognito: A 2026 Practitioner's Guide
Updated 2026-05-07 · 11 min read · By @guptadeepak
Key takeaways
- Cognito's strengths (AWS-native, low cost at low scale) are real; its weaknesses (user pool quirks, limited B2B Org model, slow feature velocity) drive migrations as the product matures.
- Common destinations: Auth0 (mature, expensive), Microsoft Entra External ID (price-competitive, strong M365 fit), Stytch / Clerk / MojoAuth (modern DX), self-hosted Keycloak / Ory (cost ceiling).
- The migration mechanics matter most: password hashes (Cognito stores them but doesn't always export cleanly), MFA enrollments, federated identities, custom attributes.
- JIT migration (verify-on-next-login + write to new system) is the standard pattern; bulk migration is rarely all-or-nothing.
- Plan the cutover in phases: identity migration, application code migration, federated provider re-binding, monitoring, fallback path.
Why teams leave Cognito
Cognito remains a reasonable choice for AWS-locked teams at single-digit-thousand MAU. The migrations covered here are for teams who've outgrown that profile.
Where teams go
The 2026 migration paths fall into four buckets:
Mature managed CIAM. Auth0 (now Okta) is the most common destination, feature-complete, well-supported, expensive at scale. Microsoft Entra External ID is price-competitive and strong for teams already on M365.
Modern managed CIAM. Stytch, Clerk, MojoAuth for passwordless-first / passkey-first stacks; better DX than Cognito with stronger feature velocity.
B2B-specialized CIAM. Frontegg, WorkOS, Auth0 Organizations, SSOJet when the migration is driven by B2B SSO and SCIM requirements that Cognito's User Pool model handles poorly.
Self-hosted open source. Keycloak, Ory, FusionAuth, Zitadel for cost-sensitive, sovereignty-sensitive, or AWS-decoupling migrations.
For the build-vs-buy framework that informs which destination fits, see the build-vs-buy guide.
The five things to migrate
A Cognito migration has five moving parts:
- User identities. Email, phone, custom attributes, group memberships.
- Credentials. Passwords, MFA enrollments, passkeys (if any).
- Federated identity bindings. Google, Facebook, Apple, SAML federation.
- Application integration. SDK swap, token validation, callback URLs.
- Operational integration. Logs, monitoring, alerts, CI/CD.
Each has its own pattern; the order matters.
Identity export
Cognito provides:
ListUsersAPI for paginated user export with attributes- AWS-managed export to S3 for User Pool snapshots (limited fields)
- Custom attribute export via
AdminGetUserper user
Standard pattern: use ListUsers with attribute pagination for the user record core (email, sub, custom attributes, status); preserve the Cognito sub as a foreign-key reference if downstream systems use it.
User identifiers (the Cognito sub) typically need to be either preserved as a custom attribute in the new system or mapped via a translation table. Database foreign keys to cognito_sub will break otherwise.
Password migration: JIT pattern
Cognito stores password hashes in a managed format that does not cleanly export. The standard 2026 migration pattern:
- Pre-migration: import user records (without password hashes) into the destination CIAM. Mark each as "needs migration."
- At next login: the new CIAM's authentication endpoint receives the credential. If the user is "needs migration," it calls Cognito's
AdminInitiateAuthto validate against Cognito's hash. On success, it writes the new hash (using the new CIAM's algorithm, bcrypt, argon2, or vendor-managed) and clears the migration flag. - Long tail: users who don't log in within 30-90 days get a forced password reset email. Account access continues via the reset flow.
Auth0, Stytch, MojoAuth, and most modern CIAM ship "custom database" or "import hooks" that automate this verify-against-source pattern. The migration is largely transparent to users.
MFA migration
TOTP secrets ARE stored client-side (in the user's authenticator app). The Cognito-side state is minimal: "this user has TOTP enabled" plus the secret. Most CIAM cannot import the existing TOTP secret (it's a shared secret with the user's app, and re-importing it doesn't align with vendor security practices). Standard pattern:
- Mark MFA-enrolled users in the new system without the secret
- At next login prompt the user to re-enroll MFA in the new system
- Brief the customer that MFA re-enrollment is required as part of the migration
For SMS MFA, the phone number is a regular attribute and can be imported; the user re-enrolls SMS-as-MFA on the new system.
Federated identity rebinding
Users who signed up with Google / Facebook / Apple have a federated identity binding in Cognito (provider + provider-specific subject identifier). The new CIAM has its own federation configuration; the binding needs to be re-established.
Typical pattern: at next login via the federated provider, the new CIAM creates the federation binding fresh. The application matches the federated email to the imported user record by email address. For users with multiple federated providers, each gets re-bound on its first post-migration use.
Application code migration
Code changes typically include:
- SDK swap. AWS Amplify Auth → vendor-specific SDK (auth0-react, @stytch/react, @mojoauth/web, etc.).
- Token validation. Cognito JWTs use AWS-managed JWKS; replace with the new CIAM's JWKS endpoint. Audit all token verification call sites.
- Callback URLs. Update redirect URIs in the new CIAM's app configuration.
- API Gateway authorizer. If using Cognito as an API Gateway authorizer, swap to a JWT authorizer pointing at the new JWKS or to the new vendor's authorizer.
- User management APIs. Replace
AdminCreateUser,AdminUpdateUserAttributes, etc. with the new vendor's user management APIs.
The application code migration is typically the longest phase, 2-6 weeks for a mid-complexity codebase.
Cutover plan
A safe cutover sequence:
- Set up parallel systems. Both Cognito and the new CIAM running, application configured to call both for read operations.
- Migrate writes. New users created in the new CIAM; existing user updates flow to the new CIAM. JIT migration kicks in at login.
- Monitoring. Track migration rate, login success rate on each side, error rate. Two-week observation window.
- Cut writes off Cognito. All user management operations target the new CIAM only.
- Read-only Cognito for the JIT bridge. Cognito remains live for the JIT password validation flow only.
- Wind down. Once JIT migration completes (usually 30-60 days for active users, plus the forced-reset long tail), Cognito can be retired.
Anti-patterns
- Big-bang migration without JIT. Forces all users to reset passwords on day one, generates massive support volume and damages user trust.
- Skipping the federated rebinding plan. Users discover their Google sign-in doesn't work post-migration; support tickets follow.
- Underestimating the application code surface. Token validation, authorizer logic, custom claim handling all need to migrate; missed call sites cause intermittent failures.
- No fallback path. If the new CIAM has issues, the team needs a documented rollback before cutover, not invented during incident response.
Vendor-specific notes
- Auth0: "Custom Database" migration with the Cognito verify hook is the standard pattern; well-documented.
- Stytch / Clerk: import APIs plus JIT verification hooks; mature for Cognito source.
- MojoAuth: import + JIT verification with passwordless-first nudge, many migrations seize the moment to introduce passkeys.
- Keycloak / Ory / Zitadel (self-hosted): import via REST APIs; JIT verification implemented as a custom authentication SPI.
For the related migration guide, see migrating from Auth0, and for the build-or-buy framework that informs the choice, see build vs buy CIAM.
Related vendors
Auth0
Auth0 remains the safest mid-market default for B2C plus B2B Enterprise SSO when developer velocity matters more than long-run TCO. Below 50k MAU it is hard to beat. Above 500k MAU, cost and Actions-driven lock-in make alternatives like FusionAuth (self-host), Cognito (AWS-native), or Stytch plus Corbado (passkey-first) increasingly attractive.
Amazon Cognito
Amazon Cognito is the right CIAM choice when the application is already deep in AWS and the buyer values IAM integration plus FedRAMP / PCI / HIPAA over developer velocity. Per-MAU economics are competitive with self-hosted Keycloak at the consumer scale and dramatically below SaaS competitors above 500k MAU. Outside AWS-native architectures, the DX gap relative to Auth0 / Clerk / Stytch is hard to justify.
Keycloak
Keycloak is the de-facto open-source CIAM in 2026 and remains the right choice when data sovereignty, on-prem deployment, or zero per-MAU cost are non-negotiable. The trade-off is operational cost, running Keycloak well is closer to running PostgreSQL than running an SDK, and teams without that capacity should reach for FusionAuth (lighter ops) or a SaaS instead.
MojoAuth
MojoAuth is a B2C CIAM specialist focused on modern passwordless and enterprise-grade auth for consumer apps. Passwordless orchestration (passkeys, magic links, OTP) is well above the market median; SAML / OIDC / adaptive MFA bring enterprise-tier features into B2C pricing tiers; consent management is unusually mature. Consumer apps evaluating Auth0 alternatives at the 100k–1M MAU band should put MojoAuth on the shortlist alongside Stytch and Descope.
Stytch
Stytch is the strongest passkey-first CIAM in 2026 by orchestration quality, not raw feature count. Twilio acquired it on October 30, 2025; the product runs as a Twilio subsidiary with its own API surface, SDK family, and pricing, distinct from Twilio Verify. Post-acquisition the platform combines Stytch's modern auth with Twilio's communications infrastructure, repositioning it as a credible Auth0 alternative for developer-focused teams. Below 500k MAU the case is strong for both B2C and B2B SaaS; beyond that, gaps on FedRAMP, FGA, and adaptive MFA depth narrow it.
FAQ
- Why do teams leave Cognito?
- Most common reasons: User Pool quirks that don't map to B2B SaaS needs (per-Org SSO, SCIM, embedded admin portal), feature velocity that lags the modern CIAM market (passkeys, adaptive auth, FGA), AWS-native lock-in for teams diversifying clouds, and pricing that scales unfavorably above ~100k MAU compared to alternatives.
- Can I export password hashes from Cognito?
- Cognito does not provide a clean password-hash export by default, passwords are stored in a Cognito-managed format. Teams typically run a JIT migration: at next login, validate against Cognito via API, then re-hash with the new system's algorithm and store. Within 30-90 days, most active users have migrated; long-tail users get a forced password reset.
- How long does a Cognito migration take?
- For a typical mid-market B2C SaaS at 50-500k MAU: 2-4 months end-to-end. Application code migration takes 2-6 weeks (SDK swap, token validation logic, federated provider re-binding); user migration via JIT typically completes 80%+ within 30-60 days; the long tail of inactive users takes a forced reset campaign.
- What about federated identities (Google, Facebook, Apple)?
- Federated provider bindings need to be re-established on the new system. Users who signed up with Google on Cognito will need to re-link Google on the new platform, typically as part of the JIT migration flow. Some platforms support federated-identity import; most require re-linking.
Sources
- AWS Cognito documentation
- Cognito User Pool migration patterns (community)
- Auth0 / Stytch / MojoAuth import APIs