问题
I want to restrict the Firebase Authentication only by ne mail domain name, to make this mail access to my application :
exemple@exemple.fr
I did this in the database side of firebase
{
"rules": {
".read": "auth.token.email.endsWith('@exemple.fr')",
".write": "auth.token.email.endsWith('@exemple.fr')"
}
}
I think i'm doing something wrong, thank you for your help.
回答1:
Try this
{
"rules": {
".read": "auth.token.email.matches(/.*@exemple.fr$/)",
".write": "auth.token.email.matches(/.*@exemple.fr$/)"
}
}
来源:https://stackoverflow.com/questions/46614476/restrict-firebase-authentication-to-a-certain-domain