How to use FireBase Authentication for SSO

Viewed 5435

How can one use Firebase to SSO into some product?

Firebase is a federated IdP, meaning, they handle the auth flows for other IdPs, ie Google, Facebook, Twitter, etc.

So how can I set up a product with SSO that is expecting some kind of Auth flow, ie OIDC, SAML, when FireBase doesn't necessarily do that? Note, I am comfortable building my own login pages and using the FireBase SDK, I'm just not sure where to start.

Let's take Google for example. I can easily setup Google SSO for my product. I just generate a client ID/Secret in the Google Dashboard, and then use Google's OAuth flow.

  1. My product initiates the login and redirects to Google for logins
  2. Google identifies my user and redirects to my product's callback URL
  3. Done, user is logged in

How would I do the same thing in FireBase, which is a sort of middleman between my product and Google?

1 Answers

If you have your own user auth system, and you want to integrate that with Firebase Auth for the purpose of creating accounts that integrate with other Firebase products, you can write a custom authentication provider. Your backend will take the user's credentials and create a custom auth token that the app can use to sign in the user.

Related