Admin and user differentiate in realtime firebase auth react native app [duplicate] - reactjs

This question already has answers here:
Multiple role authentication Firebase Web
(1 answer)
What is the best way to authenticate two types of users (Student and Driver) in my android app using Firebase [duplicate]
(4 answers)
Firebase Auth signIn distinction
(1 answer)
Closed 1 year ago.
I am Developing an react native app for parent and tutor in which that I am using email and password for signing in and signup used, so I want to differentiate the user and parent.
It is done with realtime firebase.
How it possible in Firebase? Please suggest me to resolve my issues.

Related

Firebase and React JS Authentication [duplicate]

This question already has answers here:
Firebase Auth using phone number and password
(4 answers)
Phone Number with Password Authentication using Firebase
(3 answers)
Firebase Login using Mobile number and password (without OTP)
(1 answer)
Firebase login with phone & password
(2 answers)
Closed 2 months ago.
I want to design a web page in which User can register via phone number, OTP Received and password set by user and then login with that phone number and password in future. How can i implement this feature in firebase as backend and React JS as Frontend.
i tried using firebase but there is only login method via email and Password, there is no method for phone number and password login available.

How to safely store Firebase credentials in React JS

This is a follow-up question from Firebase Multiple Accounts are signed at the same time
So, I want to create a web application using Firebase Authentication, where a user can switch between multiple accounts. The solution to that problem is linked here: https://stackoverflow.com/a/55905698/16925281
From the provided solution, we can get the Firebase credentials for any account and use it to switch. However, how can I safely store the said credentials at Client Side (Preferably, in ReactJS)?

Uncaught (in promise) FirebaseError: Firebase: Error (auth/unauthorized-domain). error [duplicate]

This question already has answers here:
Firebase Auth/unauthorized domain. Domain is not authorized
(8 answers)
Closed 4 months ago.
When I try to open google sign-in in the deployed version of my app I get this error in the console and the popup closes. I have googled a bit about this error and I found that I need to add the domain in my firebase through Authentication -> SignIn method ->Authorized domains and then add the domain I have also tried this but it doesn't work.
and when I try to open the google sign in popup I get this error in the console:
How can I enable google authentication in the deployed app?
Open Firebase
Go to console
Open your project
Go to Authentication
sign-in-method
Add domain
Try it!
In my case it's working

how to integrate google 2 factor / 2 step authentication in react app

I want to add google 2fa authentication for my react app. How can I
generate QR code for my app?
Will this be a static or a dynamic code?
Where do I need to send the secret (6 digit / 8 digit) code for
authentication once the user copies it from the google-authenticator
mobile app.
what google-api need to be enabled for this app in the
console.google.developer.com, like we enable G+ api for google sign-in?
need help!

User authentication using express and react

PS
Just note I am pretty new with react(with redux) and express in general.
My question is more of a "what do I do now?" or "help me in the right direction,please" type of question.
My english is very bad.
I am not afraid to teach myself , just show me where to look.
Most internet resources are half explained or assumes you are a pro.
I have a react client side application that needs user authentication, and after the authentication the react application needs to know if client is logged in or out
Now currently my react application is using conditional rendering which means my entire application is depended on the app-level state.
When my react application starts it starts with a login component where the user can add his email and password
Now from here on out I am completely stuck on what to do,so many questions...
How do I authenticate(from the backend) the user using his login input(email/password) and check agiants users in mongoDB if he is there or not, and if he is there how do I let front-end application know he is valid user and use that user information to access certain routes?
How can I check if user is logged in(after authentication and valid user have been authenticated) from front-end react application
Can I use cookies as a possible solution?For example set a cookie on the server-side(express) and access the cookie on the client-side(react) and vice-versa?
Little of topic(or maybe on topic) question? What is Passport.js and it help with my current dilemma ???
as far as authentication is concerned, using a JWT which will be saved in session storage and can be sent to your server app via API is a very popular approach with react/redux applications. this will be sent with all api requests so that the server app can verify that the user is logged in before serving data to them. to check if someone is logged in on the client app, you should have a reducer/saga/thunk that, upon recieving a successful login message from the server app, will update the auth reducer portion of the redux store to flip a boolean isLoggedIn property that you can expose to your props to check if you are logged in.
have a react client side application that needs user authentication, and after the authentication the react application needs to know if client is logged in or out
Now currently my react application is using conditional rendering which means my entire application is depended on the app-level state.
When my react application starts it starts with a login component where the user can add his email and password
there is a react-redux structure called the duck structure that is very good: https://github.com/erikras/ducks-modular-redux
sorry but I do not have mongodb experience but search for authentication handling and there will definitely be examples. .NET Core is excellent and there are many tutorials if you consider changing.

Resources