triauth for Firebase AuthenticationOIDC
Let the people at your domain sign in to your Firebase app with one approval on their own device.
- 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
Open oidc.triauth.org and enter your domain. Paste Firebase's redirect address,
https://example-app.firebaseapp.com/__/auth/handlerwith your own project ID in place ofexample-app, and click Connect app. The bridge gives you a client ID and a client secret.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.Field Value Grant type Code flow Name example.com, which gives the provider IDoidc.example-comClient ID and Client secret from the bridge Issuer (URL) https://oidc.triauth.org/example.comIn your app, sign in with that provider ID:
javascriptconst provider = new OAuthProvider('oidc.example-com'); provider.addScope('email'); provider.addScope('profile'); const result = await signInWithPopup(auth, provider);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
| Setting | Value |
|---|---|
| Redirect address | https://<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 Firebase | the Firebase console, or Identity Platform › Identity Providers in the Google Cloud console |
| Issuer | https://oidc.triauth.org/<your domain>. Firebase reads the discovery document from it |
| Flow | the 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 |
| Sessions | Firebase 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
- Read the OpenID Connect bridge page for what every connected app gets and what the bridge keeps private.
- Read Roll out to your team to give everyone in your organization an identifier at your domain.
- Read Groups to publish the groups your backend turns into claims.
- Read Firebase's OpenID Connect guide for every setting Firebase offers.
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.