且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Firebase Facebook身份验证:电子邮件验证始终是错误的

更新时间:2023-12-06 07:59:16

谷歌供应商电子邮件验证和Facebook电子邮件不是因为Google被视为值得信赖的提供商(您可以使用Google创建电子邮件帐户)。再举一个例子。如果您使用雅虎设置电子邮件,您将收到一封电子邮件myself@yahoo.com。如果您使用雅虎OAuth 2.0登录,那么您肯定知道该用户已被验证,因为雅虎是该电子邮件地址的实际所有者和颁发者。但是,您也可以使用同一封电子邮件创建一个Facebook帐户或其他一些帐户,如github或twitter,并使用您的电话号码或其他方式进行验证。在这种情况下,如果您使用Facebook登录,则电子邮件未经验证(Facebook不拥有或管理该电子邮件地址)。通常情况下,如果你想在这种情况下验证电子邮件,你必须发送电子邮件验证(目前的实验,只有在网络和iOS可用,但最终应该来到Android)。

As said in the title, no matter how I try the Facebook login, the emailVerified field is always false. Is this by design? I've read through the whole firebase docs by now, can't seem to find any information regarding this. Just to be sure: I've tried with 4 different verified accounts, the result is always the same. Any idea what could cause this kind of behavior?

the reason why Google provider emails are verified and Facebook emails are not is because Google is considered a trusted provider (You can create an email account using Google). Let's take another example. If you set up an email with yahoo, you will get an email myself@yahoo.com. If you sign in using yahoo OAuth 2.0, you know for sure that user is verified since Yahoo is the actual owner and issuer of that email address. However, you could also use that same email to create a facebook account or some other account like github or twitter and verify using your phone number or some other means. In that case, if you sign in using Facebook, the email is not verified (facebook does not own or manage that email address). Normally if you wish to verify the email in that case, you have to send the email verification (experimental at the moment and only available in web and iOS but should eventually come to android).