RealmDeployDocs
Migration

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.

Passwords do not move. Firebase hashes passwords with its own modified scrypt, and Keycloak does not ship a provider for it. Password users set a new password by email link after the move.

1. Export users

firebase auth:export users.json --format=json --project <project-id>

Use JSON: it keeps providerUserInfo, customAttributes and mfaInfo whole. The file holds password hashes, so treat it as a secret.

2. Convert

Open the Firebase to Keycloak users converter. It writes:

  • email, emailVerified, enabled (from disabled) and createdTimestamp
  • displayName split at the first space into firstName and lastName
  • custom claims as attributes, the claim you name as groups, and localId as firebase_uid
  • UPDATE_PASSWORD for password users; users with only google.com, apple.com or other social providers get none

passwordHash, salt and mfaInfo are left out. Phone-only users have no email, so they are listed as warnings: Keycloak has no built-in SMS sign-in.

3. Switch your apps

In FirebaseIn Keycloak
Firebase Auth SDK in web and mobile appsOpenID Connect with the authorization code flow and PKCE
ID token verification in your backendKeycloak's issuer and keys at /realms/<realm>/protocol/openid-connect/certs
Custom claimsAttributes plus a user attribute mapper on a client scope
Social providersIdentity providers; register the new redirect URI
Blocking functionsRequired actions, mappers or application code
Second factorsUsers enroll again

Mobile apps need a released version that signs in with Keycloak before you cut over.

4. Dry run, then cut over

Import into a staging realm with partial import and sign in from each app. At cut-over, stop sign-ups, export again, import, and send the set-password emails in batches. Keep Firebase Authentication unchanged until you sign the move off.

The Firebase migration page covers what each plan includes.

On this page