Migrate from Firebase Authentication to Keycloak without forcing a password reset
Firebase auth:export can move user profiles and scrypt-hashed passwords, but Keycloak cannot verify those hashes on its own, so the effort depends on hash handling, social providers and application cutover rather than on user count. Your team runs apps on Firebase SDKs, and the decision to self-host identity means the work spans three separate problems: getting users out, making their existing passwords work in Keycloak, and moving every web and mobile client to OpenID Connect. Each of those has its own dependencies, so the number of applications and identity providers you need to cut over drives the scope more than the size of the user base.
The password path is the decision that needs the earliest attention. Firebase exports only passwords hashed with its modified scrypt algorithm, and the signer key, salt separator, rounds and memory cost come from the Firebase console for your project. Keycloak's built-in algorithms do not include that scheme, so a custom hashing provider built with the Server Developer Guide must verify these hashes. Confirm with your own Firebase project that every user in the export actually carries a hash, since accounts created through social sign-in or phone sign-in will not. Keycloak keeps stored hashes unchanged until each user next logs in, which is what allows migration without a forced reset, provided the provider is in place before the first login.
This is a fixed-scope project. Agree in writing which applications, identity providers (Google, Apple, email link or others you use in Firebase), and mobile and web clients are included, and what the cutover window looks like for each. Ask any partner to quote the custom hashing provider, the social provider mapping, the OIDC client changes in each app and the parallel-run testing separately, since these recur differently and carry different risk. Ask also who owns the Firebase project decommissioning and the retention of exported files, which contain credentials.
What maps cleanly from Firebase Authentication and what does not
This table compares the Firebase Authentication capabilities most teams rely on with their Keycloak equivalents and flags the items that need a custom provider, user re-enrollment or app code changes. Read the last column first to see where the migration plan needs extra work before the cutover date is set.
| Capability | Keycloak equivalent | Migration effort |
|---|---|---|
| Email and password sign-in with scrypt hashes | Realm users with password credentials, verified by a custom hashing provider for Firebase scrypt | Custom provider needed. Firebase scrypt is not a built-in Keycloak algorithm |
| Email and password sign-in with other hash types | Built-in argon2 or pbkdf2-sha512 hashing, with hashes rehashed at each user's next login | Low effort if passwords are already stored in a supported hash format |
| Social sign-in (Google, Apple, Facebook, GitHub) | Identity brokering with social identity providers and first-login account linking | Provider linking needed. Subject IDs differ, so check each mapping |
| Custom claims set through the Admin SDK | Protocol mappers and user attributes emitted in OIDC tokens | App code changes needed where claim names or token shape differ |
| Email verification status | Email verified flag on the user, with required actions for unverified accounts | Verify export carries the flag. Confirm the import sets it per user |
| Phone number sign-in with SMS codes | No built-in SMS OTP. Use a custom authenticator, an SMS gateway or another factor | Re-enrollment or custom build required. Phone factors do not move as credentials |
| Multi-factor enrollment (TOTP, phone) | OTP policies and WebAuthn or passkeys in the browser flow | Users usually re-enroll factors. Plan a fallback for lost devices |
| Session and token handling in the Firebase SDK | OIDC authorization code flow with PKCE, refresh tokens and realm session settings | App code changes needed in mobile and web clients. Plan an SDK replacement |
| Project-level sign-in configuration | Clients, redirect URIs and realm settings created per application | Manual setup per app. Build a configuration inventory before cutover |
Why Firebase scrypt hashes need a custom Keycloak hashing provider
Firebase Authentication will not give you a password you can verify anywhere else. The auth:export command only exports passwords hashed with Firebase's modified scrypt algorithm, the default for new projects, and the values needed to verify them are not in the export file. The signer key, salt separator, rounds and memory cost are shown in the Firebase console, so someone with console access must copy them out before the export is run. Confirm that the project's hash parameters are retrievable and recorded in your migration runbook, and store the signer key as a secret, because anyone holding it and the exported hashes can run offline password guesses.
Keycloak cannot verify these hashes with its built-in algorithms. Its password hashing options are argon2 (the default outside FIPS mode), pbkdf2-sha512 (the default under FIPS), pbkdf2-sha256 and the deprecated pbkdf2 (SHA-1). Scrypt with Firebase's modifications is none of these, so the migration needs a custom hashing provider built with the Keycloak Server Developer Guide. That provider has to reproduce Firebase's exact derivation from the exported hash, salt and the console parameters, and it must be tested against known accounts before any user is moved. Ask your engineers to name the owner of this code and plan for it to be rebuilt when the Keycloak release changes the provider interfaces.
The provider also sets the cutover plan. Keycloak keeps each stored password hash unchanged until that user next logs in, so the migrated accounts keep their old hash format for as long as they stay inactive. Decide early whether inactive accounts will remain on the Firebase-format hash indefinitely, whether you will force a password reset for them, and how long Firebase stays available to authenticate users during the transition. Plan monitoring that shows how many accounts still hold the original hash, because that number tells you when the custom provider can be retired.
Documented export and import paths for Firebase users
Moving users from Firebase Authentication to Keycloak depends on three documented paths: exporting from Firebase, creating users and realms in Keycloak, and deciding how password verification works between them. Each path exports or creates different things, so the cards below set out what each one moves and what your own project must confirm before you rely on it.
Firebase auth:export output
The auth:export command writes Firebase user records to a file, including profile fields and, for accounts that use Firebase's scrypt algorithm, the password hash. The hash parameters that Keycloak needs to verify those passwords, such as the signer key, salt separator, rounds and memory cost, are not in the export and must be read from the Firebase console. Confirm which users in your project have password hashes, which use only social or phone sign-in, and whether any accounts use a different hashing method.
Firebase auth:import for reference
The matching auth:import command loads users into a Firebase project from a file in the same format. It is useful for understanding the record shape and for testing a round trip in a non-production project, but it does not move anything into Keycloak. Use it to confirm that the export file you produce is complete before you build any transformation step, and never run it against a production project as part of this work.
Keycloak admin console and Administration REST API
Realms, clients, identity providers, roles and users can be created in the Keycloak admin console or through the Administration REST API, which scripts can call to load large user sets. Neither path brings over Firebase password hashes by itself. Check that your import script sets the required user attributes, handles duplicate email addresses, and records which Firebase user ID maps to which Keycloak user so that later logins and audits can be traced.
Keycloak admin guideUser storage providers for legacy verification
The Keycloak server administration guide describes user storage providers, which let Keycloak look up users in an external store. Pairing one with a custom hashing provider is the usual route for verifying Firebase scrypt hashes at login, because Keycloak's built-in algorithms do not cover them. Confirm with your own team whether you will import users up front or verify them at first login, since the two designs carry different data-retention and cutover consequences.
Keycloak admin guideHashing provider and rehash behavior
Keycloak's built-in password hashing covers argon2, pbkdf2-sha512, pbkdf2-sha256 and the deprecated pbkdf2, and other algorithms need a custom hashing provider built with the Server Developer Guide. When the hashing algorithm changes, Keycloak keeps stored hashes as they are until each user logs in again. Plan for accounts that never return, since their Firebase-hashed passwords will remain unverifiable in Keycloak unless you keep the Firebase verification path running for them.
Keycloak admin guideHow the Firebase to Keycloak migration runs in phases
The sequence moves users, password verification and application sign-in from Firebase to Keycloak in stages, so each stage has a check that must pass before the next one begins. Each phase produces evidence that the previous one worked.
Inventory apps, providers and token claims
Your team lists every application, web and mobile, that signs in through Firebase, along with the sign-in providers each one uses (email and password, phone, and social providers), the custom claims the apps read, and any Firebase Admin SDK calls that create or modify users. The output is a written inventory that maps each app to its required Keycloak client, provider and claim. The step is done when the application owners have signed off on the list and no app is missing from it.
Export users and capture hash parameters
Run the Firebase CLI auth:export command against the project to produce the user file. Record the scrypt hash parameters shown in the Firebase console (signer key, salt separator, rounds and memory cost) in a secured location, because the export does not carry them. The step is done when the record count in the export matches the Firebase console and the parameters are stored with access limited to the migration team.
Build and test the custom hashing provider
Your engineers build a custom password hashing provider for Keycloak that reproduces Firebase's modified scrypt verification, since Keycloak's built-in algorithms do not include it. The provider is tested against a sample of real exported users with known passwords, and every sampled user must verify successfully. The step is done when the sample passes in a non-production realm and the test results are recorded.
Import users and configure the realm
Import the exported users into a dedicated Keycloak realm and configure the authentication flows, required actions, password policy and the custom hashing provider. Confirm that imported users have the expected attributes and that roles and groups match the inventory. The step is done when a test login for each sign-in method succeeds and the realm configuration is exported and kept under version control.
Map social providers and brokering
Configure each social sign-in provider that Firebase used as a Keycloak identity provider, then map the upstream identity to the existing Keycloak user so that people who sign in with Google or another provider keep the same account. Confirm how email matches are handled and which accounts require linking. The step is done when a test account for each provider signs in to the same Keycloak user it used in Firebase.
Pilot with a test app and small user group
Point one non-critical application at Keycloak using the OIDC client settings from the inventory, then invite a small group of users to sign in through it. Check that tokens carry the expected claims, that logout works and that the custom hashing provider rehashes passwords at login as intended. The step is done when the pilot group signs in without incidents and the team has a written list of issues and fixes.
Run both systems in parallel and cut over clients
Keep Firebase sign-in active while Keycloak is available, then move web and mobile apps to Keycloak one group at a time, using OIDC redirect URIs and client settings verified in the pilot. Before cutover, confirm in writing how hash verification and login-time rehashing are ordered, since passwords must be verified against the original hash before being stored in a new one. The step is done when each app signs in through Keycloak and the cutover log records the date and owner of each change.
Decommission Firebase after the cutover window
After the agreed cutover window closes and no application still depends on Firebase Authentication, disable Firebase sign-in, retain the export and configuration records under your retention policy and remove the Firebase Admin SDK calls from the applications. The step is done when logs show no Firebase sign-in attempts for the agreed period and the decommissioning record is signed by the application and security owners.
How a migrated login flows through Keycloak after cutover
The diagram starts in a web or mobile app that redirects the user to Keycloak over OIDC. Keycloak looks up the user in the imported profile store, and on first login it verifies the legacy Firebase scrypt hash through the custom hashing provider, then stores a new hash using a Keycloak algorithm. Social sign-in passes through brokered identity providers. The dashed boundary separates the public frontend from the admin console, which should stay on a separate hostname.
Login path for a migrated user, with the admin console kept outside the public frontend.
What drives the cost and duration of a Firebase to Keycloak move
This table compares the factors that change the effort of moving users and apps from Firebase Authentication to Keycloak, and whether each one is paid once or recurs. Read each row against your own Firebase projects to see which items dominate your scope. The main takeaway is that hash retrievability and the number of client apps usually decide the plan more than user count does.
| Driver | Why it changes cost or effort | How to keep it down |
|---|---|---|
| Firebase projects and apps | Each project has its own users, sign-in settings and authorized domains, so each one is a separate export and mapping exercise. This work is one-time. | Consolidate into fewer target realms where the business allows, and confirm the project count before quoting. |
| Users with scrypt hashes | Only passwords hashed with Firebase's scrypt variant come out of auth:export. Keycloak needs a custom hashing provider to verify them, which is a one-time build and test cost. | Confirm with the export whether every user has a hash, and count any users without one, since they need a different path. |
| Hash parameters in the console | The signer key, salt separator, rounds and memory cost are shown in the Firebase console. If an owner cannot retrieve them, password verification cannot be built as planned. | Confirm early who holds console access and get the parameters recorded through a controlled channel. |
| Social sign-in methods | Each provider (for example Google, Apple or Facebook) needs a new identity provider in Keycloak, client registration and attribute mapping. This is one-time per provider. | List every provider in use, including ones that appear only in old code paths. |
| Phone-based sign-in | Phone numbers and SMS factors may not map to Keycloak credentials the same way, and users may need a re-enrollment step. Confirm the design and any SMS provider contract before scoping. | Decide early whether phone users re-verify at first login or keep a separate flow. |
| Custom claims | Claims set through Firebase custom claims must be rebuilt as Keycloak protocol mappers or user attributes, and every consuming service must read the new token shape. | Inventory claims by consuming service so each mapper maps to a named owner. |
| Firestore and security rule dependence | Firestore security rules that check Firebase auth tokens must be rewritten against OIDC tokens, or the data access path moves to a backend service. This can be the largest item in the plan. | Find every rule that reads request.auth and decide the replacement before the cutover date is set. |
| Mobile and web clients needing OIDC changes | Each client moves from the Firebase SDK to an OIDC library with its own redirect URIs, token storage and logout behavior. Effort rises with each client and platform, and mobile release cycles add time. | Group clients by SDK and platform so one pattern serves many apps. |
| Keycloak hosting and database | Hosting choice, the supported database, high availability design and load testing set the one-time build effort. Ongoing operation, patching and upgrades recur. Confirm the target architecture and its operating owner. | Reuse the existing platform team's standards and automate deployment as code. |
| Parallel run and rollback | Running Firebase and Keycloak side by side, with a tested path back, adds build, monitoring and support effort during the window. Requirements depend on your risk tolerance and contract terms, so confirm them in writing. | Define the cutover waves and rollback triggers in the plan before work starts. |
What usually goes wrong in Firebase to Keycloak migrations
Most Firebase to Keycloak migrations fail at the seams: password verification, token and redirect changes, account linking and exposure of the new server. The cards below cover the risks we see most often, the prevention step for each, and the details you must confirm in your own environment.
Hash parameters wrong or missing
Firebase exports scrypt hashes only with their project-level parameters: the signer key, salt separator, rounds and memory cost. If any value is copied incorrectly or omitted, every imported password fails verification and users are locked out at first login. Store the parameters in your secrets manager, then test a sample of known test accounts through the custom hashing provider before any user is imported. Confirm the parameter values against the Firebase console for your exact project.
Firebase auth docsHashing provider drifts after upgrades
The custom hashing provider is code built against Keycloak's Server Developer Guide, so it is not updated by the server upgrade. A Keycloak upgrade that changes provider interfaces can stop the provider loading, and users with unmigrated hashes then fail to sign in. Keep the provider in version control, add a login test to the upgrade checklist, and confirm the provider build against the exact target release before you upgrade production.
Keycloak admin guideSocial accounts create duplicate users
A user who signed in with Google in Firebase may use a different email address in Keycloak, or the provider may return a different address later. Without a deliberate account-linking rule, the same person ends up with two Keycloak accounts and two sets of roles. Decide the matching key (verified email, provider subject identifier or a manual review queue) before import, and test each social provider with accounts whose emails differ.
Mobile apps break at cutover
Mobile and web apps that moved from the Firebase SDK to OpenID Connect depend on redirect URIs, custom URL schemes, client IDs and token formats. A new redirect URI that is not registered on the Keycloak client, or a stored Firebase ID token that the app tries to reuse, causes sign-in loops for users already in the app. Register every redirect URI for each platform before release, keep the old flow available during a staged rollout, and test on current iOS and Android builds.
Keycloak admin guideOld sessions survive cutover
Firebase sessions, refresh tokens and sessions still open on devices can remain valid after users move to Keycloak. If the old sign-in path is switched off without revoking these sessions, access can persist outside the new identity controls, and a user who was disabled in Keycloak may still reach applications. Plan an explicit revocation step, set token lifetimes deliberately, and verify that disabling a user in Keycloak ends access in each application.
Keycloak exposed on a public admin path
During a migration, teams often publish the new Keycloak quickly to test mobile flows, and the admin console or Administration REST API ends up on the same hostname as public login pages. Keycloak's production guidance calls for TLS everywhere, a reverse proxy with path restrictions, and the admin console on a different hostname or context path from public frontend URLs. Confirm those rules are in place on every test and staging host before real users or real credentials reach the system.
Questions teams ask before moving off Firebase Authentication
How much does a Firebase Authentication to Keycloak migration cost?
The cost is set by the written scope, not by a list price, and DeployOpen does not publish one. Most of the spend falls into a few components: discovery of your Firebase projects and user base, the export and import tooling, a custom hashing provider to verify Firebase scrypt hashes, social identity provider mapping, reconfiguring each web and mobile client to OIDC, a test plan, and cutover and support. Some of this is one-time work, and some recurs through upgrades of Keycloak and the custom provider. Ask any provider to quote each component separately, to state which apps and environments are in scope, and to say who pays for Keycloak hosting, licensing (none for the Apache 2.0 project itself) and ongoing support. Keycloak is licensed under Apache 2.0, so software licensing is not usually the cost driver.
How long does moving users off Firebase Authentication take?
Duration depends on how many Firebase projects and client apps exist, how many users hold password credentials, how many social providers are in use, and how many releases your mobile apps need before the cutover. Teams with one web app and a small user base have a much shorter path than teams with several iOS and Android builds that must each switch SDKs. The custom hashing provider and its test cases take time because every stored hash must verify correctly before any user is moved. Ask for a phased plan with named milestones, a parallel run period, and the dependencies on app store release cycles. No duration is stated here because none was supplied for this work.
Can Firebase scrypt password hashes move to Keycloak without a password reset?
Yes, in most cases, but only with a custom hashing provider. Firebase's auth:export command exports only passwords hashed with Firebase's scrypt algorithm, a modified version of scrypt, and it includes the hash parameters: the signer key, salt separator, rounds and memory cost. Keycloak's built-in algorithms are argon2, pbkdf2-sha512, pbkdf2-sha256 and the deprecated pbkdf2, so it cannot verify Firebase scrypt natively. A custom provider built with the Keycloak Server Developer Guide must verify the hash using the project's parameters. Keycloak keeps stored hashes unchanged until each user next logs in, and at that point the password can be re-hashed with a built-in algorithm. Confirm that your export contains the hashes and that you have the project parameters from the Firebase console before you commit to a no-reset plan.
What does the migration need from our team?
The work needs decisions and access from several people. App owners must confirm which web, mobile and backend apps depend on Firebase tokens, and they must plan the switch to OIDC libraries and redirect URIs. Someone with Firebase console access must provide the hash parameters and the export, and must confirm which sign-in methods each project uses. Security or compliance leads should approve the password handling and the retention of exported data. A test plan is essential: it should cover login with migrated passwords, social sign-in, token validation on backends, session expiry, password reset, and logout. Plan for staged environments that mirror production, and agree who signs off each cutover step.
Can our internal team run this migration alone?
An internal team can do it if it has people who know identity protocols and Java-based Keycloak extension work, and if it has the time to run a parallel environment safely. The skills that matter most are OIDC and OAuth 2.0 for client reconfiguration, Keycloak administration and deployment, Java development for the custom hashing provider, and secure handling of exported password data. Teams without that combination often find the hashing provider and the mobile SDK changes take longer than expected. A reasonable approach is to have your team own the app changes and operations while an implementation partner handles the export, hashing provider and cutover tests, or to run a fixed-scope engagement with knowledge transfer. Ask each option for a written list of deliverables.
What happens to users who sign in with Google, Apple or other social accounts?
Social sign-in users are usually handled by mapping their provider identity to a Keycloak identity rather than by moving a password. Keycloak supports social providers including Google, GitHub, GitLab, Microsoft, Facebook, LinkedIn, PayPal and Twitter, and identity brokering with OIDC, OAuth and SAML providers. The main work is to create each provider in Keycloak with its own client credentials and redirect URIs, to link existing accounts by a verified email or a stable provider subject, and to test that users land in the same account. Firebase's social user records do not carry passwords, so these users typically return through the brokered provider on their first login after cutover. Confirm which providers your Firebase projects use, whether Apple is among them, and how duplicate accounts with the same email will be resolved before go-live.
Running Keycloak after the move: patching, upgrades and HA
Plan the operating model for Keycloak before you retire Firebase, because the release cadence sets your patching workload. The current release is 26.8.1, published October 13, 2026. Since Keycloak 26.0 the project has planned four minor releases a year and a major release every two to three years, and it has said that breaking changes in a minor release will be opt-in. Decide who reviews each release, which version your production environment pins, and how quickly a minor update must reach production. If you use the Keycloak Operator, the project strongly recommends manual approval mode for operator updates, so an upgrade happens only when your team approves it. Test each candidate version against a copy of the migrated realm, including the password-upgrade path and your mobile and web sign-in flows.
Choose a production database from the supported list before cutover, not after. The supported options include PostgreSQL 14 to 18, MariaDB, MySQL, Microsoft SQL Server, Oracle Database, EnterpriseDB Advanced, Amazon Aurora PostgreSQL and Azure SQL. The default dev-file database is for development only. Keycloak applies schema migrations at startup by default, but the upgrading guide suggests manual migration for large deployments, so confirm which method your change process allows. For high availability, the project documents a single cluster optionally spread across availability zones and a multi-cluster (v2) design, while the v1 multi-cluster design is deprecated. Both supported designs depend on a synchronously replicated database, and the 26.8 upgrade notes recommend moving from the deprecated multi-site feature to the stateless feature. Confirm the replication and failover behavior of your chosen database with your own team before go-live.
Keep the admin console and Administration REST API on a different hostname or context path from your public frontend URLs, and put a reverse proxy in front of Keycloak with path restrictions. Your Firebase-era apps and mobile clients need only the public sign-in endpoints, so the proxy should block administrative paths from the public internet. Terminate TLS for all communication, as the production guide requires. Enable metrics with --metrics-enabled=true so Keycloak serves Prometheus-format data at /metrics on its management interface, and confirm that your proxy does not expose that path publicly. Decide whether you need the optional HTTP request and cache histograms, since they add detail to your dashboards and alerts.
How DeployOpen scopes and delivers the Firebase to Keycloak migration
DeployOpen approaches the move from Firebase Authentication to Keycloak as a fixed-scope engagement inside your own infrastructure. We start by inventorying what auth:export can and cannot carry, then build, test and document the hashing provider, login flows and app cutover so your security and compliance teams can review each step.
How we scope
- Inventory Firebase projects, sign-in providers, custom claims and the hash parameters needed for auth:export.
- Confirm which password hashes can be verified and which users need a reset or gradual migration path.
- Agree in writing the target Keycloak hosting, realms, client list, social providers and mobile and web app cutover order.
How we build
- Build and test a custom password hashing provider that verifies Firebase scrypt hashes using your project parameters.
- Map Firebase social sign-in identities to Keycloak identity providers and link accounts without creating duplicates.
- Move web and mobile apps to OpenID Connect flows, then test token handling, refresh and logout before go-live.
How we hand over
- Document the export procedure, hashing provider configuration, user mapping rules and rollback steps in a runbook.
- Provide test evidence for login, password verification, social sign-in and logout for each application.
- Walk your operations and security teams through monitoring, admin access and how the hashing provider is maintained.
How we support
- Support the cutover window and fix defects found during the first live logins under the agreed scope.
- Offer ongoing support, Keycloak upgrades and continuous security testing as a retainer after handover.
- Ask for a written quote tied to the agreed scope, timelines and deliverables before any work starts.


Mapping social sign-in and moving mobile and web apps to OIDC
Social sign-in is where a Firebase migration most often breaks for users, so start by inventorying every provider enabled in the Firebase console and matching each one to a Keycloak identity provider. Keycloak documents Google, GitHub, GitLab, Microsoft, Facebook, LinkedIn, PayPal and Twitter as social providers in its server administration guide. Confirm that each Firebase provider you use (Google, Apple, Facebook or others) has an equivalent in that list or can be configured as a generic OpenID Connect identity provider. Apple and any provider not on the documented list need a generic OIDC or SAML setup, and you should test that configuration against the provider's own documentation before relying on it. Register new redirect URIs with each upstream provider that point at your Keycloak broker endpoint, because the old Firebase callback URLs will not work for Keycloak.
Linked social accounts need an explicit account linking decision. A Firebase user who signed in with Google and also has a password, or who has two providers that share an email address, may map to one Keycloak user or to two. Decide in advance whether Keycloak links accounts by verified email, requires the user to confirm the link after signing in with an existing credential, or creates separate accounts. Test each path with real Firebase export data, because the export carries the provider linkage that drives this mapping. Users who relied on a provider that Keycloak does not support directly will need a support plan, not only a configuration change.
Application code is the other half of the work. Firebase SDKs handle tokens, refresh and sign-out inside the client, so each web, single-page and mobile app has to move to a standard OpenID Connect library with Keycloak issuing the tokens. Create a separate Keycloak client for each web app, single-page app and mobile app, with its own redirect URIs and, for mobile, a public client using authorization code flow with PKCE. Review the backend side too, since services that verified Firebase ID tokens must validate Keycloak tokens against the realm's signing keys. Logout needs its own test plan: confirm that ending a session in one app ends it where you expect, that tokens are revoked or expire as designed, and that mobile apps clear stored tokens correctly on every platform you support.