1
votes

Is it possible to authenticate or link with custom unsupported (not Google, Facebook, Twitter and Github) providers?

I'm interested to let my users sign in with Linkedin, or Flickr, for example. I don't own their APIs, so I can't use a custom token as described in documentation.

Linking requires use of AuthCredential, but I didn't yet find examples on how to build a custom AuthCredential for a new service.

What would be a viable solution to solve this? Custom mapping on the client between firebaseAuthToken and unsupportedProviderAuthToken?

1

1 Answers

3
votes

You can add any identity provider to Firebase Authentication by implementing a so-called custom authentication provider.

You'll need to run code on a trusted environment for this (typically an app server). This code needs to perform the actual authentication and then mints a JSON Web Token (JWT) with the user's information. See the Firebase documentation on creating custom tokens.

Then in the Android app, you use the custom JWT to authenticate the user with Firebase.

There are also some good example on the Firebase blog: