'FIrebase auth log in as other user

I am building an E-learning platform.

We used WordPress but I built a react native app with a firebase database and now we want a react website that connects to the same database.

So now if a user has a problem, we can click a button in WordPress and log in as that user. It's handy if someone has a problem. Is this possible with firebase? I know it's the worse for security but I'm curious🙈

I have tried to find some things about it but I can't see it.



Solution 1:[1]

In Firebase, go to your project and go below "Authentication" page. From here, click on "Sign in method". Below Sign in providers, press "Add new provider" - you can here see which login opportunities you have from Firebase authentication. Hope this answer your questions

enter image description here

Solution 2:[2]

Update #2:

"So when for example a user "karin" has a problem i can login as "karin" and see what she sees." => Ok, I think I totally misunderstood your question.

If you want to login as a specific user you need to know his/her credentials, including the password. Or you need to build some specific screens in your app that (1) simulate the content shown to this user and (2) that you can access with your Admin profile.


Previous, irrelevant answer:

I built a react native app with a Firebase database and now we want a react website which connects to the same database.... we can click a button in WordPress and log in as that user.

There is no problem at all to connect to the same Firebase database (the back-end) from different front-ends, including several web apps/sites or a mix of native mobile apps and a web app/site.

If I understand correctly, you want, from a Wordpress website to be able to authenticate against Firebase Auth and connect to the Firebase database. You could either use the JS SDK in your Wordpress pages (I've never tried and don't if it is feasible) OR use the Firestore REST API and the Firebase Auth REST API with, for example, the fecth API and the Wordpress wrapper around this API.


Update based on your comment below: "I want that I can login as a user with Firebase Auth"

For that you will use the signInWithPassword method and get the user name contained in the Firebase Auth ID token returned by the Auth REST API after the login.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jonask
Solution 2