Skip to content

Migrate between providers

iamigrate moves users in three steps: it exports a source into the Canonical Migration Format (CMF), checks the file against what the target can import, and imports it. What changes from one provider to the next is what survives the trip. The biggest difference is passwords: each provider hashes them with its own algorithms, and most can only import some of them. Second factors and profile fields vary too.

Each guide below covers one pair, with the commands to run and the caveats specific to it. It builds on the export guides and import guides, which describe each provider on its own.

ProviderAs a sourceAs a target
Auth0YesYes
Azure AD B2CYesNo
FirebaseYesYes
KeycloakYesYes
Ory KratosYesYes
AWS CognitoNoYes

Azure AD B2C only exports, and AWS Cognito only imports. A move between two instances of the same provider, such as two Keycloak realms, doesn’t need a pair guide: follow that provider’s export guide, then its import guide. A CSV or JSON file can also be the source, see export.

When a target can’t import a user’s hash, it doesn’t create the user, unless you drop their password first, which each guide shows how to do. Cognito takes no hash at all, so it creates every user without a password. Find the algorithms your users hold in manifest.json after the export.

AlgorithmAuth0AWS CognitoFirebaseKeycloakOry Kratos
bcryptYesNoYesNoYes
Argon2YesNoNoYesYes
PBKDF2YesNoNoYesNo
scryptYesNoYesNoNo

Kratos takes argon2id only. Firebase’s own scrypt variant, which is what a Firebase export holds, is understood by Firebase alone, so the scrypt row doesn’t help a Firebase source. Auth0 also accepts MD4, MD5, SHA-1, SHA-256, SHA-512, HMAC and LDAP hashes. Auth0 and Azure AD B2C never return hashes, so exports from them have none to compare.

No source reads organizations, roles or groups, so they never travel with the users, whichever pair you pick. Auth0 is the only target that can receive them, from files you write. Cognito, Firebase, Keycloak and Ory Kratos ignore those files: recreate groups and roles on the target yourself (Kratos has none of its own, they live in Ory Permissions).

To create organizations and roles in Auth0, build the files from the source’s own API or database, and put them in the directory of the users file:

{"source_id":"org-acme","name":"acme","display_name":"Acme Inc."}

in organizations.cmf.jsonl, and

{"source_id":"role-admin","name":"admin","description":"Full access"}

in roles.cmf.jsonl. Then give each user record its place in them, using those source_id values:

{"memberships":[{"organization":"org-acme","roles":["role-admin"]}],"global_roles":["role-admin"]}

memberships adds the user to an organization with the roles it holds there, and global_roles are roles that apply outside any organization. import auth0 creates the roles and organizations first, reusing any that already exist under the same name, then adds the members. A failure of this second phase is reported as ROLE_ORG_PHASE_ERROR, and the Management API credentials need the organization scopes listed in the Auth0 import guide.

ToPasswordsSecond factors
AWS CognitoReset, or Lambda triggerNot exported
FirebaseReset, or merge a hash fileNot exported
KeycloakResetNot exported
Ory KratosReset, or merge a hash fileNot exported
ToPasswordsSecond factors
Auth0Reset, or check at sign-inNot exported
AWS CognitoReset, or check at sign-inNot exported
FirebaseResetNot exported
KeycloakReset, or check at sign-inNot exported
Ory KratosResetNot exported
ToPasswordsSecond factors
Auth0ResetSMS carries over
AWS CognitoReset, or Lambda triggerRe-enroll
KeycloakResetRe-enroll
Ory KratosResetRe-enroll
ToPasswordsSecond factors
Auth0KeptTOTP carries over
AWS CognitoReset, or Lambda triggerRe-enroll
FirebaseResetRe-enroll
Ory KratosPartly kept (Argon2 only)TOTP blocks the import, re-enroll
ToPasswordsSecond factors
Auth0KeptNot exported
AWS CognitoReset, or Lambda triggerNot exported
FirebasePartly kept (bcrypt only)Not exported
KeycloakPartly kept (Argon2 only)Not exported