Subscribe to the Non-Human & AI Identity Journal

Firebase Custom Token

A Firebase custom token is a short-lived assertion that lets an external identity provider create a Firebase Auth session. It is not a general password replacement. Its value lies in subject continuity and controlled federation across Firebase services that trust the same session identity.

Expanded Definition

Firebase Custom Token is a federation mechanism used to exchange trust from an external identity system into Firebase Auth. It is a short-lived assertion, not a reusable password, and it should be treated as a credential-handling event with strict issuance controls. In NHI programs, the important distinction is subject continuity: the token maps an external principal to a Firebase session while preserving the expected identity context across services. That makes it closer to a signed bridge than a bearer secret meant for broad reuse.

Definitions vary across vendors on whether custom tokens should be discussed as application credentials, identity assertions, or federation artifacts, but the security requirement is the same: they must be minted only for a verified subject and accepted only within a tightly bounded trust path. The most relevant external reference point is the NIST Cybersecurity Framework 2.0, which frames identity assurance, access control, and governance as operational disciplines rather than one-time setup tasks. The most common misapplication is using a Firebase custom token as a long-lived client credential, which occurs when teams embed minting logic into apps or logs instead of keeping issuance server-side.

Examples and Use Cases

Implementing Firebase custom tokens rigorously often introduces extra server-side issuance logic, requiring organisations to weigh smoother user federation against tighter key protection and lifecycle management.

  • A workforce portal issues a Firebase custom token after verifying an employee in a corporate IdP, then maps the resulting Firebase session to the correct tenant and app role.
  • A backend service mints custom tokens for mobile users who authenticate externally, avoiding duplicated passwords while preserving subject continuity across Firebase-backed features.
  • An engineering team rotates the signer key used to mint tokens and stores the minting service’s private material separately from application code, reducing the blast radius if one component is exposed. This is the kind of control discussed in NHIMG’s Guide to the Secret Sprawl Challenge.
  • A federated customer app uses a custom token only after upstream identity proofing, rather than letting the frontend self-assert identity.
  • Security teams review how token issuance is logged, because exposed assertions can become part of the same credential sprawl pattern seen in incidents such as the Salesloft OAuth token breach.

Why It Matters in NHI Security

Firebase custom tokens matter because they sit at the junction of identity federation, secrets handling, and session trust. If the minting key is exposed, attacker-controlled sessions can be created without needing to crack a password. If the token is logged, cached, or passed through insecure tooling, it becomes another inventory item in the broader secret sprawl problem. NHIMG research shows that 44% of NHI tokens are exposed in the wild, often in collaboration platforms and code commits, which is exactly why token-based federation must be governed as a lifecycle issue, not just an authentication feature.

Practitioners should pair minting controls with revocation awareness, storage hygiene, and least-privilege session design. The token should exist only long enough to establish the Firebase session, then disappear from application traces, build output, and support tickets. Operational discipline also aligns with identity governance expectations in the NIST Cybersecurity Framework 2.0 and the broader secret-exposure patterns documented in NHIMG’s Guide to the Secret Sprawl Challenge. Organisations typically encounter the real impact only after a token is leaked or abused, at which point Firebase Custom Token handling becomes operationally unavoidable to address.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 and OWASP Agentic AI Top 10 address the attack and risk surface, while NIST CSF 2.0, NIST SP 800-63 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-02 Addresses secret exposure and token handling risk in NHI issuance flows.
NIST CSF 2.0 PR.AC Identity proofing and access control underpin trusted federated session creation.
NIST SP 800-63 Digital identity guidance informs assurance for federated subjects and session binding.
NIST Zero Trust (SP 800-207) Zero trust requires each session to be explicitly established and continuously bounded.
OWASP Agentic AI Top 10 Agentic systems often mint or exchange tokens and need strict tool-initiated credential controls.

Keep custom-token minting server-side, protect signer keys, and remove tokens from logs and code paths.