oauth 2.0 - Creating firebase user with authentication information from Salesforce - Stack Overflow

admin2025-04-17  5

I have a scenario where I am doing OAuth2 authorization to Salesforce and I get in response access token, refresh token etc. I can of course use the access token to get the user info from Salesforce.

The backend of the application is in cloud functions and these needs to be secured with authentication. I would like to secure these with the Firebase authentication information.

Is it possible to create the Firebase user with the OAuth2 authorization information from Salesforce programatically without having to ask the user to authenticate separately to Firebase

I have a scenario where I am doing OAuth2 authorization to Salesforce and I get in response access token, refresh token etc. I can of course use the access token to get the user info from Salesforce.

The backend of the application is in cloud functions and these needs to be secured with authentication. I would like to secure these with the Firebase authentication information.

Is it possible to create the Firebase user with the OAuth2 authorization information from Salesforce programatically without having to ask the user to authenticate separately to Firebase

Share Improve this question asked Feb 1 at 10:31 jani_rjani_r 7312 gold badges8 silver badges26 bronze badges 1
  • It sounds like maybe you want to implement custom authentication? – Doug Stevenson Commented Feb 1 at 14:02
Add a comment  | 

1 Answer 1

Reset to default 1

One way to implement this use-case is with custom authentication in Firebase. Step-by-step you:

  1. Sign the user in to Salesforce as you already do
  2. Take the relevant information from their Salesforce token
  3. Mint a Firebase token with that information (this happens in a trusted environment)
  4. Sign the user in to Firebase with the token (this happens on the client).

The Firebase specific steps 3 and 4 can be done without user interaction.

You can then use the information of the user that is signed in to Firebase in the usual way.

转载请注明原文地址:http://www.anycun.com/QandA/1744832238a88239.html