Android Firebase Email Validation

孤人 提交于 2019-12-08 03:26:13

问题


I am developing an app with Firebase and I have to register users to the app using email registration method provided by Firebase. I pretty much did well on Email verification and such things, but one problem, I'm encountering is that "how to validate" entered email address?

By validation, I don't mean if its a correct email form, such as blab@blabla.com pattern, for example Iamsomething@gmail.com is an invalid email which cant get email verification, although it is perfectly fine in terms of email pattern.

I want to make sure that invalid emails are not registered to authentication database in the first place. How can I solve this problem?


回答1:


You cannot prevent users from creating an account on Firebase Authentication with an email account they don't own.

That is precisely why you'd implement email verification in your app: to you can prevent those users from accessing other resources. For example, you can ensure that only users with a verified email address can access the Firebase Database with:

{
  "rules": {
    ".read": "auth.token.email_verified == true"
  }
}

See my answer here for an extended version of that: How do I lock down Firebase Database to any user from a specific (email) domain?



来源:https://stackoverflow.com/questions/41665179/android-firebase-email-validation

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