0

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

ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56
Matthieu
  • 199
  • 2
  • 3
  • 15
  • Consider using custom claims: https://stackoverflow.com/questions/36878040/how-do-i-set-up-roles-in-firebase-auth – bojeil Jul 09 '18 at 17:22

1 Answers1

0

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

orimdominic
  • 995
  • 10
  • 23