如何使用Firebase进行自定义身份验证?

如何使用Firebase进行自定义身份验证?

问题描述:

请原谅任何明显的知识匮乏...这就是为什么我在这里...

Excuse any apparent lack of knowledge... that's why I'm here...

如何在Firebase中创建自定义Auth方法?

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

我想创建一个系统,通过该系统,在应用程序安装时会自动为应用程序用户分配一个从其设备硬件派生的唯一用户名(他们从未看到过),而只需提供密码即可.仅(某些)设备有权(预)使用该应用.我已经使用PHP/mySQL实现了此功能,但是我正在将该应用程序转换为Firebase.

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.

我正在使用Android,但不确定是否重要.感谢您的帮助.

I'm using Android, but not sure that matters. Thanks for any help.

电子邮件"一词是否只是字符串的任意名称,也可能是用户名"?

Is the term "email" simply an arbitrary name for a string that could just as well be a "username" ?

是,不是.

我从未使用过Firebase的密码身份验证,但是您可能需要提供一些有效的电子邮件地址才能成功完成此用户注册.
因此,您只需将用户注册为<fingerprint>@mydomain.com.

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