Skip to content
Customer Identity · available nowBuild your first Test integration.Create a Test project
NamoID
All posts
NamoID Blog

Replace Firebase Authentication Without Rebuilding Your Entire Backend?

Keep Firestore while evaluating a new login provider. Compare OIDC federation, custom-token bridges, server-mediated access, and the dependencies each retains.

Retrospective series date: 2026-11-15. This label describes the series order, not a historical publication.

You can keep Firestore while changing the login architecture. The important decision is how application requests reach the database. Replacing a login screen alone does not change the identity that Firestore Security Rules expect.

For an Indian startup, this can avoid an unnecessary database migration. It can also reveal more application work than an authentication SDK swap suggests. Draw the current access path before deciding what to replace.

Inventory the Firebase dependencies first

List every client, function and background job that reads or writes customer records. Record which identity it presents and where permissions are enforced.

DependencyQuestion to answer
Direct browser or mobile readsWhich Security Rules authorize each record?
Realtime listenersDoes the client depend on a Firebase session?
Offline client behaviorWhich features require the existing SDK path?
Backend database operationsWhich service credential and IAM permissions apply?
User identifiers in document pathsHow will the application map old and new identities?
Authentication-triggered functionsWhich lifecycle events and user records do they expect?
Storage and other servicesWhich separate rules and credentials need review?

Keep storage location, account identity and business permission as different fields in the plan. They can change independently.

Distinguish the architecture options

Firebase supports external OIDC providers through its documented Identity Platform configuration. It also supports custom-token sign-in. Those approaches keep Firebase Authentication in the access path. OIDC provider configuration, custom-token documentation.

OptionWhat changesDoes Firebase Auth remain?
Keep the current SDK routeExisting login and data access remain togetherYes
Federate an external OIDC providerExternal provider handles a login journey; Firebase issues its own credentialsYes
Build a reviewed custom-token bridgeBackend maps the upstream identity and creates a Firebase custom tokenYes
Move database access behind your APIAPI authenticates users, applies policy and accesses Firestore through server credentialsCan be removed from that application's access path

This is a design comparison. It does not establish a prebuilt NamoID connector, approved federation configuration or completed migration.

Understand a Firebase-retaining bridge

In a custom-token design, the backend establishes the upstream identity and maps it to the intended Firebase user identifier. The client exchanges the custom token through Firebase Authentication. It then uses the resulting Firebase identity context.

External identity -> reviewed backend mapping -> Firebase custom token
                                                         |
Client -> Firebase Auth exchange -> Firebase session -> Firestore Rules

A custom token is not a general replacement for a Firebase ID token. A token signed by another provider is not automatically accepted by Firestore. Google's documentation describes the exchange and the resulting user session. Custom-token sign-in.

Review mapping collisions, account suspension and both systems' session lifetimes. Disabling an upstream session does not prove the resulting Firebase session ended. Preserve a tested revocation route for each system.

Understand server-mediated Firestore access

In a server-mediated design, your client calls your API. The API validates the authenticated context and checks the business permission. It then accesses Firestore using its authorized server identity.

Client -> application API -> authentication + resource policy -> Firestore
                                  |
                          authorized server credential

Firestore server libraries bypass Security Rules and use their separate credential and IAM boundary. Your API must therefore enforce the intended user-level restrictions. Firestore server access boundary.

Use a least-privilege runtime identity. Separate environments. Check the active organization before reading customer records, and constrain queries to the authorized data boundary. The managed-auth security responsibility guide provides a synthetic permission example.

Close unintended direct-client paths

If all intended application access moves behind the API, review direct client access explicitly. Do not leave permissive rules because the frontend no longer imports the old SDK.

The following illustrates a Firestore database that denies direct mobile/web reads and writes. It does not restrict the authorized server-library path.

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if false;
    }
  }
}

Review the entire ruleset. Another matching rule can allow access. This illustration applies to Firestore, not to Storage rules or every Google service. Confirm the deployed database and rules before release. Firestore Rules conditions.

The route also changes the application experience. Existing direct listeners, offline behavior, pagination and file access need their own design. Server mediation is not a drop-in promise that every Firebase client feature continues unchanged.

Rehearse one resource before changing the whole application

Use the Firestore identity-boundary worksheet. Start with a low-impact resource and synthetic accounts.

  1. Draw the current client-to-data path.
  2. Select the intended identity and data-access architecture.
  3. Map old identifiers to stable application accounts.
  4. Test an allowed request through the new route.
  5. Test another customer's identifier and a removed membership.
  6. Test unintended direct access to Firestore.
  7. Review existing sessions, listeners and background jobs.
  8. Record rollback and credential-removal conditions.

Test Security Rules with the appropriate emulator tooling, then verify approved staging configuration separately. The emulator does not establish every production behavior. Firestore emulator documentation.

The Firebase migration guide owns credential export, factor compatibility and cutover planning. Keep those tasks separate from the database access decision.

Review the NamoID integration path with our team

NamoID engineers can help review hosted sign-in, API token validation and the proposed identity boundary. Bring the current data-access diagram before assuming any bridge or federation path is supported for your configuration.

If your goal is removing Firebase Authentication, we can help identify the application dependencies that remain. Your team still owns Firestore access policy, server credentials and migration tests.

Share your stack, current Firebase services and intended account flow in Slack for an early response. Contact the NamoID team

NamoID is not affiliated with or endorsed by Google or Firebase. Architecture references reviewed on 16 November 2026.