Moving from Azure AD B2C
List users from Azure AD B2C or Entra External ID with Microsoft Graph, convert them for Keycloak, and re-create apps and user flows. Local accounts set a new password by email link.
Passwords do not move. Microsoft Graph never returns a password and there is no hash export. Local accounts set a new password by email link after the move. The same applies to Microsoft Entra External ID.
1. Export users
List users with Microsoft Graph. Select identities and each extension attribute by name, because they are not returned by default:
GET https://graph.microsoft.com/v1.0/users?$select=id,displayName,givenName,surname,mail,otherMails,identities,accountEnabled,createdDateTime,extension_<app-id>_<name>&$top=999Follow @odata.nextLink until it is gone and put every page's users into one value array. For groups, expand memberOf.
2. Convert
Open the Azure AD B2C to Keycloak users converter. It writes:
- the sign-in email (or
mail) asemailand, by default, the username; auserNameidentity as the username if you choose it givenName,surname,accountEnabled,createdDateTimeextension_<app id>_<name>as the<name>attribute, andidasb2c_object_id- groups from
memberOf UPDATE_PASSWORDfor local accounts; federated identities get none
Graph has no per-user verified flag, so emailVerified is false unless you tick the option.
3. Re-create the rest
| In B2C | In Keycloak |
|---|---|
| App registration | Client with the same redirect URIs |
| User flows | Realm login settings, registration and authentication flows |
| Custom policies | Flows, mappers or application code; REST calls in policies have no direct counterpart |
| Social and enterprise identity providers | Identity providers; register the new redirect URI |
| MFA (TOTP, SMS, email) | Users enroll again; Graph returns TOTP secrets as null |
Apps keyed on the object id (oid) see a new subject in Keycloak tokens: map b2c_object_id into the token.
4. Dry run, then cut over
Import into a staging realm with partial import and sign in through each app. At cut-over, stop sign-ups, export again, import, switch the apps and send the set-password emails in batches. Keep the tenant unchanged until you sign the move off.
The Azure AD B2C migration page covers what each plan includes.
Moving from Amazon Cognito
List Cognito users and groups, convert them for Keycloak, and re-create app clients and identity providers. Password users set a new password by email link.
Moving from Firebase Authentication
Export Firebase users with the CLI, convert them for Keycloak, and switch your apps to OpenID Connect. Password users set a new password by email link.