0
votes

Is it possible to use firebase Authentication (sign in with email) and an user roles management ? I'm using ionic and would like to login to the app with some users who have different roles. I would like to use the Firebase Firestore to store other data.

What is the best solution to do it ?

Thanks

1
Consider using custom claims: stackoverflow.com/questions/36878040/… - bojeil

1 Answers

0
votes

Well, I actually hoped that there was a feature like this too but as far as I know, there isn't as at the moment. What can be done though is ask a user to choose his/her role while registering/signing up, and then this role gets stored with the user's other details that may be needed; then when this user wants to login, your application checks if the user is a registered user and then checks the database for the user's details (the role inclusive) and then the app works with the user based on this role. Not a very good implementation but the closest I can proffer because this is the method I use

You can check out this question too how do I implement role based access control in firebase