Firebase 密码验证允许正则表达式 [英] Firebase Password Validation allowed regex

查看:23
本文介绍了Firebase 密码验证允许正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人知道 Firebase 的电子邮件和密码身份验证 API 的官方允许密码.

I was wondering if anyone knew the official allowed passwords for Firebase's Email and Password Authentication API.

到目前为止我知道有

  • 至少需要 6 个字符
  • a-z 允许
  • 允许 A-Z
  • 允许 0-9
  • 允许使用特殊字符 ~`!@#$%^&*()-_+=|}]{["':;?/>.<,
  • 允许使用空格

如果是这种情况,我这边用于验证的正则表达式是否只是 {6,} ?(或者我可以检查字段的长度)

If this is the case, would the regex for validation on my side just be {6,} ? (alternatively I could just check the length of the field)

我认为它类似于 Google 的正常密码要求,但是只需要 6 个字符而不是 8 个.

I assume it's similar to Google's normal password requirements but only requiring 6 characters instead of 8.

推荐答案

你的理解是正确的 - 唯一的要求是最少 6 个字符.

Your understanding is correct - the only requirement is a minimum of 6 chars.

但是,如果您正在构建 Android/iOS 应用程序,我建议不要在您的应用程序中对验证逻辑进行硬编码,因为新用户注册请求由 Firebase 身份验证服务器处理.

However, if you are building Android/iOS apps, I would suggest -not- to hardcode the validation logic in your app, since the new user signup request is handled by Firebase Auth server.

这篇关于Firebase 密码验证允许正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆