Firebase Simple Login Username

1,741 views
Skip to first unread message

Daniel Berg

unread,
Apr 10, 2014, 2:52:16 PM4/10/14
to fireba...@googlegroups.com
Hello, I am pretty new to this and just messing around trying to learn...

Is there any way to login via username rather than email address with simple email/pass login? I have a unique username stored in the user's data upon registration. Is it a horrible idea to do a lookup upon login based on username to fetch their email and auth with that?

I started with this as a code base.
https://github.com/firebase/angularFire-seed


Michael Wulf

unread,
Apr 10, 2014, 7:52:37 PM4/10/14
to fireba...@googlegroups.com
Hi Daniel,

If you're set on using email/password auth with a username instead, you can simply index the users to email addresses in a sep path. Then when a user authenticates, look up their email in the index:

/user_to_email_index/$user_name/<email address>

However, while you can easily prevent listing of all the addresses, you can't really prevent someone from putting in an email directly and finding out a user's email (since they won't be authenticated at the time).

You may be ahead to just sign your own tokens and keep things simple. 

Cheers,
Kato
 


--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Berg

unread,
Apr 11, 2014, 12:11:09 AM4/11/14
to fireba...@googlegroups.com
Thanks, that is what I was thinking but I figured that could be a security issue. I think I will just keep the login via email and use the username elsewhere.
Reply all
Reply to author
Forward
0 new messages