How to do custom Auth using Firebase?

笑着哭i 提交于 2019-12-11 06:24:33

问题


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.


回答1:


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".



来源:https://stackoverflow.com/questions/39134998/how-to-do-custom-auth-using-firebase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!