Save user information to Firebase Realtime Database

Asked

Viewed 1,181 times

1

In accordance with the documentation says, one should not use the getUid() user to authenticate users to the backend server; instead, use the getToken(). However, I see a lot of code out there using this attribute to save user-specific things, for example, an X user’s to-do list. What should I wear in a suit?

  • I think the Firebase recommendation is to avoid linking user authentication to id (which is immutable) as opposed to token (which can be invalidated at any time). But you can continue using id to reference user related data smoothly, just don’t use it to control user session.

  • Thank you for your reply, @Wakin!

1 answer

1

Firebase’s recommendation is like the recommendation of any other language: It is recommended, but not mandatory. What happens is that actually using token is a safety recommendation. Because by nature a token is variable, so it can be valid several times for varying each section. Already the uuid it’s like PRIMARY KEY from a relational bank

Browser other questions tagged

You are not signed in. Login or sign up in order to post.