Skip to content

triauth for Firebase AuthenticationOIDC

Let the people at your domain sign in to your Firebase app with one approval on their own device.

  • Identity and access
  • Cloud service
Sign-in through
OpenID Connect bridge
Available in
Projects upgraded to Identity Platform
Set up in
Firebase console › Authentication › Sign-in method

About Firebase Authentication

Firebase Authentication is Google's sign-in service for app developers. The app calls the Firebase SDK, and Google runs the accounts, passwords, social logins, and sessions. Its upgrade, Identity Platform, adds sign-in through any OpenID Connect provider, with the same SDK calls in the app.

Connect Firebase Authentication to triauth

Firebase signs people in through the triauth OpenID Connect bridge, as an OpenID Connect provider. Once connected, your app offers a button of your own, the person types their username on the bridge's page, and approves on their own device. Firebase then issues the app its usual tokens. Nobody keeps a password for your app, and when someone leaves, removing their identity records at your domain ends their way in as well.

How it works

  1. Open oidc.triauth.org and enter your domain. Paste Firebase's redirect address, https://example-app.firebaseapp.com/__/auth/handler with your own project ID in place of example-app, and click Connect app. The bridge gives you a client ID and a client secret.

  2. In the Firebase console, open Authentication › Sign-in method, click Add new provider, choose OpenID Connect, and fill in the fields below with your domain in place of example.com. Save.

    FieldValue
    Grant typeCode flow
    Nameexample.com, which gives the provider ID oidc.example-com
    Client ID and Client secretfrom the bridge
    Issuer (URL)https://oidc.triauth.org/example.com
  3. In your app, sign in with that provider ID:

    javascript
    const provider = new OAuthProvider('oidc.example-com');
    provider.addScope('email');
    provider.addScope('profile');
    const result = await signInWithPopup(auth, provider);
  4. Open your app and click your sign-in button.

Checkpoint

The button opens a page from the bridge that asks for the username, and the person's authenticator asks them to approve. Firebase then returns a signed-in user whose email address is verified.

Good to know

  • Everyone with an identity at your domain gets a Firebase user the first time they sign in, with their identifier as email address. To let only one team in, limit the app to a group when you connect it.
  • Roles in a Firebase app are custom claims set by your backend. The groups published at your domain arrive in the sign-in result's profile, for your backend to read.
  • Sign-in through an OpenID Connect provider is part of Identity Platform, the paid upgrade of Firebase Authentication, with a free allowance of such users per project.

For the person who connects the app

SettingValue
Redirect addresshttps://<project ID>.firebaseapp.com/__/auth/handler, or https://<your authDomain>/__/auth/handler when the app serves the handler from its own domain. Web, Android, and iOS all use it
Where in Firebasethe Firebase console, or Identity Platform › Identity Providers in the Google Cloud console
Issuerhttps://oidc.triauth.org/<your domain>. Firebase reads the discovery document from it
Flowthe code flow with the client secret. Firebase does not document whether it uses PKCE or which client authentication method it sends, and the bridge accepts either
SessionsFirebase issues its own tokens and refreshes them itself, so nothing from the bridge needs renewing

Firebase's OpenID Connect guide covers the console and the web SDK, and the Identity Platform guide the same provider from the Google Cloud side.

Next steps

All logos and trademarks belong to their respective owners and do not imply affiliation or endorsement of the organization or product by triauth, nor vice versa. The content provided on this page may include information from third-party sources. We do not assume any responsibility for the completeness, correctness, or applicability of the information. You should independently verify any details before relying on them.