Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I manually view an authenticated user's display name in Firebase?

I know that you can set/retrieve an authenticated user's display name using Firebase but where is this being stored? Can I login to the Firebase console to see the display name?

Thank you!

Edit: Basically, the reason I need to be able to do all this is to prevent 2 users from having the same display name (username).

like image 358
user3647894 Avatar asked Nov 20 '17 22:11

user3647894


People also ask

How can I get user details of Firebase authentication?

If the user login with a custom "email/password" you don't know anything else about that user (apart from the unique user id). If a user login with Facebook, or with Google sign in, you can get other information like the profile picture url. It is explained here: firebase.google.com/docs/auth/android/… .

How do you check if a user is already signed in Firebase?

var user = firebase. auth(). currentUser; if (user) { // User is signed in. } else { // No user is signed in. }

How do you change the app name on Firebase authentication what the user sees?

You should make these modifications in the Google API Console (https://console.cloud.google.com). Go there, find your project's credentials, click "OAuth consent screen" and then there is a textbox that says "Product name shown to users", change the current name to your app's name and click "Save".


1 Answers

Where is the Firebase user's display name being stored ?

Well it's a good question because it's hidden somewhere but it's not easily displayed.

Can I login to the Firebase console to see the display name ?

You can log in into the Firebase console but you won't see the display name.

Prevent 2 users from having the same display name (username).

For this, one solution is to store somewhere in your Firebase realtime database all the usernames. (Like a specific node for usernames). And then either in code, you can check if it already exists or use database security rules to invalidate an already taken username. But only with the display name info from Firebase authentification you can't prevent duplicates.

like image 162
Arrabidas92 Avatar answered Sep 23 '22 20:09

Arrabidas92