Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase auth, is the user uid security sensitive?

I was wondering if getAuth().uid is sensitive/private in anyway? I am planning to use it on a user post something like: post.created_by: getAuth().uid. This makes writing rules/logic a lot easier.

The other way is to use the push id when the user is added to the database, which I'm trying to avoid.

like image 358
user4691858 Avatar asked Oct 25 '25 01:10

user4691858


1 Answers

No its safe to use the uid and recommended, firebase uses auth to authenticate the user and the assign the uid to identify the user across firebase.

You will be using uid in your security rules and as well as to identify user info in your db records. Manually creating another id will render the efficiency of firebase useless.

like image 73
Umar Hussain Avatar answered Oct 27 '25 19:10

Umar Hussain