Associate a custom auth provider with Firebase

I read that with Firebase, I can allow users to log in to my application using several authentication providers by associating autoresponder credentials with an existing user account. Is it possible to link a custom auth provider such as Linkedin? I read that I need to pass an AuthCredential object to the linkWithCredential input method, but I did not find a custom AuthCredential.

+4
source share
1 answer

One way to associate an unsupported user token with an existing account is to get the Firebase account user ID and the unsupported vendor user ID and save a hash map that accepts the unsupported provider ID and returns the firebase uid you need for the link. When a user subscribes to an unsupported provider with a user token, you get the corresponding firebase uid from the card and return a user token with that uid, which, with signInWithCustomToken, is allowed using the original firebase user.

The disadvantage is that you do not see an unsupported provider in the list of provider data within the user. You also need to save the map.

+5

Source: https://habr.com/ru/post/1658409/


All Articles