0

Is there a way to add a "Full Name" field to the Email/Password authentication on Firebase? (Using Swift)

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Omar Sinan
  • 117
  • 2
  • 10
  • Do you mean the auth UI ? Or just generally adding metadata to a user? – eikooc May 29 '16 at 19:30
  • @eikooc just adding the extra fields to database – Omar Sinan May 29 '16 at 19:34
  • 1
    You could store each user's account info along with their username, and then when they try to log in, see if their full name matches the one in your database associated with that password and email – Lahav May 29 '16 at 20:02

2 Answers2

3

You cannot add your own custom field to the Firebase Authentication social providers (Facebook, Google, etc) or email+password. You can of course store such information in your Firebase Database, keyed by the user's ID:

users
  uid_209103
    fullName: "Frank van Puffelen"

Note that Firebase Authentication already has a displayName property for each user, which may cover your needs.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • 1
    How would you go about checking if a username stored in this way is taken? – GJZ Jun 05 '16 at 14:54
  • I’m trying to implement email/password auth using firebaseAuthUI. On first login for new user it asks specifically for users full name but I cant seem to access it from the authUser data after login. Why would firebaseAuthUI ask a new email/password user for their full name but not make that full name available afterwards? – lozflan Feb 21 '19 at 22:45
1

We cannot add a new field in Firebase Authentication. However, you can still store a user's full name, Firebase does provide this facility. Either you can use Firebase Database to store a user's information as Frank van Puffelen stated in his answer above.

Or if you are just trying to save user's name, you can update User's profile (DisplayName and ProfilePhoto link). For iOS, Update User's Profile in FirebaseAuth

For Android, Update User's Profile in FirebaseAuth

It comes in handy when you have a basic app and you want to store only little information about the user such as their Display Name or Profile Profile only. What I do is, after creating a new user, update the user's profile immediately.

Shahzad Ansari
  • 317
  • 3
  • 10