Reputation: 7497
Excuse any apparent lack of knowledge... that's why I'm here...
How can I create a custom Auth method in Firebase?
I do not see an option for "username/password" -- only "email/password."
Is the term "email" simply an arbitrary name for a string that could just as well be a "username" ?
I would like to create a system whereby app users are automatically assigned a unique username (that they never see) derived from their device hardware at app install time, only having to provide a password. Only certain devices are (pre) authorized to use the app. I had already implemented this with PHP/mySQL, but I'm in the process of converting this app to Firebase.
I'm using Android, but not sure that matters. Thanks for any help.
Upvotes: 1
Views: 538
Reputation: 41440
Is the term "email" simply an arbitrary name for a string that could just as well be a "username" ?
Yes and no.
I have never used Firebase's password authentication, but you'll likely need to provide some valid e-mail address for this user registration to finish successfully.
So you could simply register your users as <fingerprint>@mydomain.com
.
But please note that if you go this path, if your user loses his/her password, then they won't be able to reset them, as the password reset methods require a valid e-mail address.
But, after all, I don't think you'll need passwords, as a "simple action" like changing the hardware will invalidate the previous fingerprint.
With that said, you are left with the choice over using some password that only the app knows and using anonymous authentication - which I'm not sure about, as there are lots of mentions of "temporary account".
Upvotes: 1