Sign-in is the part of an app nobody wants to touch. It has worked for years, users have accounts, and any change risks thousands of people seeing a login screen in the morning — or worse, landing in an empty new account with no order history. Even so, when we take over and maintain apps, we hear the same question more and more often: can accounts be moved from Firebase Authentication (or another service) to our own backend or to a different provider?
They can, and usually without signing anyone out. This article covers when such a change makes sense, what exactly has to be moved, how to deal with passwords that cannot be read, and what it costs.
When changing providers makes sense
The most common reasons app owners come to us with:
Reason What is happening Do you really need a new provider? The project sits in a former contractor's account Firebase or another service is registered to a company you no longer work with Usually not — transferring project ownership is enough, as described in our article on moving an app to another account Rising costs SMS sign-in is billed per message, enterprise sign-in (SAML, OIDC) is billed per active user Sometimes changing the sign-in method or protecting SMS sending is enough Business customer requirements Customers want to sign in with their company account (SSO), plus roles and user management on their side Often yes, if the current setup does not support it Outdated SDK The sign-in library is being retired, e.g. Google Sign-In for Android in favour of Credential Manager No — that is a library swap in the app, not a change of account provider Consolidation with your own backend Accounts live in two places, the sign-in service and your own database, and keeping them in sync keeps breaking Yes, if the data drift causes real bugs Legal and contractual requirements A customer or auditor requires personal data to be processed in a specific location or by specific subprocessors Depends on the requirements — some services let you choose the data regionThe second and fourth columns are the most important part of this table. Plenty of projects that reach us as a "sign-in migration" end with a project ownership transfer, a library swap or rate limits on SMS sending. That is a few days of work instead of a few weeks.
What has to be moved
A user account is more than an email address and a password. Before the migration, list everything the sign-in service stores and the app relies on:
- User ID (e.g.
uidin Firebase). It is usually a key in the database: orders, settings and subscriptions are attached to it. The new system must either keep the old ID or maintain a mapping table. - Passwords — or rather their hashes. More on that in the next section.
- Linked social accounts: Google, Apple, Facebook. Each has its own user identifier and its own rules.
- Phone number and email verification status. Without them, some users will be asked to verify again after the migration.
- Second factor (MFA). Check what the current service exports — the second factor often has to be enrolled again.
- Active sessions. A signed-in user holds a refresh token issued by the old provider. Ignore it and everyone gets signed out.
- Everything that verifies tokens: the backend, cloud functions, database access rules (e.g. Firestore Security Rules), third-party integrations. This is often forgotten when the work is estimated.
Passwords: export, import or migration at sign-in
Passwords are not stored as such, only as hashes. The new system has to be able to check the password a user types against the old hash — otherwise everyone has to reset it.
With Firebase Authentication, accounts are exported with the firebase auth:export command, and the hash parameters (signer key, salt separator, rounds) are read from the console. These parameters are sensitive — together with the export file they allow offline password cracking attempts, so treat them like production keys. The catch is that Firebase uses its own modified version of the scrypt algorithm. Not every target system supports it.
There are two approaches:
Approach How it works Pros Cons Bulk import Export all accounts with password hashes and import them into the new system in one step Fast, the old system can be switched off right away Only works if the new system supports the hash algorithm; the export has to be timed with the switchover Migration at sign-in (lazy migration) When a user signs in to the new system and has no account there, the system checks the password against the old one and only then creates the account Works with any algorithm, and the password is stored in the new format along the way The old system has to keep running for months; accounts of people who never sign in have to be moved differentlyMigration at sign-in is supported by ready-made mechanisms such as the Migrate User trigger in Amazon Cognito or automatic migration from a custom database in Auth0. With your own backend it is one extra endpoint. In practice we usually combine both: active users move over when they sign in, and after a few months the remaining accounts are moved by import — with the password if possible, or with a prompt to set a new one at the next sign-in.
Signing in with Google, Apple and SMS
Google. The Google user ID is stable for a given account, so moving the links is straightforward. The migration is a good moment to replace the Google Sign-In library in the Android app with Credential Manager — Google has marked the old library as deprecated and announced its removal. We cover such deadlines in more detail in our article on deprecated SDKs and APIs.
Apple. The Sign in with Apple user identifier is tied to the developer team (Team ID). As long as the app stays in the same Apple account, changing the provider does not change it. There are, however, two App Store requirements to keep in mind:
- guideline 4.8 — if the app offers sign-in with Google, Facebook or another third-party service, it must also offer an equivalent option that limits data collection to name and email and lets users keep their email private. In practice this is usually Sign in with Apple, and it must not disappear during the migration,
- guideline 5.1.1(v) — an app that lets users create an account must let them delete it, and with Sign in with Apple the backend should revoke the tokens via the Sign in with Apple REST API. More in our article on store privacy requirements.
SMS. Phone numbers are easy to move, but this is a good moment to look at costs. In Firebase, SMS sign-in requires a paid plan and is billed per message sent, and a new SMS provider will have its own pricing. Whatever the provider, the code-sending endpoint needs rate limits — otherwise you are exposed to SMS pumping, described in our article on the most common security vulnerabilities.
How to switch the app without signing users out
The biggest risk is not the account database but the app that is already installed on phones. The plan we follow:
- An abstraction layer in the app. App code asks for the signed-in user and token through its own class, not directly through the provider's SDK. This is the first release and changes nothing for users.
- The backend accepts both kinds of tokens. During the transition, the API accepts tokens from both the old and the new provider and maps them to the same user.
- Session exchange. On first launch, the new app version sends the current old-provider token to the backend, which verifies it and issues a session in the new system. The user does not notice anything.
- Switching behind a flag. The new sign-in path is hidden behind a remote configuration flag, rolled out gradually and switchable off within minutes.
- A parallel period. Old app versions keep signing in through the old provider, so it has to keep running as long as a meaningful share of users is on them. We describe how versions coexist in our article on API changes and old app versions.
- Switching off the old provider. Only after enforcing a minimum supported version and moving the remaining accounts.
Between steps we monitor successful and failed sign-ins, password resets and new registrations. A sudden rise in new accounts usually means that some users were not linked to their old data.
What not to change along the way
A sign-in migration is a tempting moment to redesign the login screen, add passkeys and change password rules. Better not to do it in the same release. If users cannot sign in after the rollout, a single change tells you where to look. New sign-in methods, such as passkeys supported by Credential Manager on Android and by iOS, are worth adding as a next step, once the new system runs reliably.
The same goes for the backend: once accounts live in your own database, their security, backups and updates are the app owner's responsibility, not the service provider's. Include that in your backend maintenance plan.
What it costs
Scope Estimated effort At PLN 180 net per hour Analysis: what the current provider stores, what verifies tokens, choice of approach 8–16 h approx. PLN 1.4k–2.9k Abstraction layer in the app (Android and iOS) 16–40 h approx. PLN 2.9k–7.2k Backend: accepting two kinds of tokens, session exchange, migration at sign-in 24–60 h approx. PLN 4.3k–10.8k Account import, ID mapping, tests on a copy of the data 16–40 h approx. PLN 2.9k–7.2k Replacing Google Sign-In with Credential Manager (if needed) 8–24 h approx. PLN 1.4k–4.3k Rollout, monitoring, parallel period and switching off the old system 8–24 h approx. PLN 1.4k–4.3kThese figures are estimates and depend on the number of sign-in methods, the app's technology and how many places in the backend verify tokens. The rate is an example — we set the actual cost after reviewing the project. On top of that come the new provider's fees or the cost of maintaining your own solution.
Summary
Changing the sign-in provider can be done without signing users out, but it needs a plan: keeping user IDs, a well-thought-out password migration, session exchange in the new app version and a period in which both systems run in parallel. Before you start, check whether a project ownership transfer, a library swap or protecting SMS sending would solve the problem. Do not combine the migration with a login screen redesign, and remember the App Store requirements for Sign in with Apple and account deletion.
We run sign-in migrations as part of mobile app maintenance and backend and API work, and when taking over a mobile app we check where user accounts live and who has access to them. If you want to know what state your app is in, order a free app analysis or get in touch.