将Firebase Google OAuth身份验证限制为特定用户 [英] Limit Firebase Google OAuth Authentication to specific users

查看:220
本文介绍了将Firebase Google OAuth身份验证限制为特定用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Firebase处理我的网站的Google OAuth登录信息。有谁知道如何限制有权访问应用程序的用户?例如,我只希望x@gmail.com,y@gmail.com和z@gmail.com成功地通过谷歌登录到我的应用程序。



我不确定这是Firebase还是Google的问题,但是任何帮助都不胜感激。 Firebase的身份验证只能通过您启用的任何机制来处理用户的身份验证 这些用户是否有权访问您的数据称为授权,并通过您的Firebase安全规则处理。

所以:

>


  • 认证允许用户使用您的应用程序识别他/她自己。请参阅 Firebase的身份验证文档(适用于JavaScript / Web),但它存在于所有支持的平台上)。
  • 授权限制根据用户的身份验证对特定用户的数据进行读/写访问。请参阅 Firebase有关其安全规则的文档

  • ul>

    将您的数据限制到特定的电子邮件地址当然是可能的。我建议您阅读 Firebase关于其安全规则的文档,并尝试使其工作基于此。如果您有任何问题,请发布您已经尝试过的内容,我们将能够帮助您更好地完成。


    I'm using Firebase to handle my Google OAuth login for my website. Does anyone knew how to restrict the users who have access to the application? For example, I only want x@gmail.com, y@gmail.com, and z@gmail.com to successfully be able to log in via google to my application.

    I wasn't sure if this was a Firebase or Google question, but any help would be much appreciated.

    解决方案

    Firebase's authentication handles only that: the authentication of users through any of the mechanisms you enable. Whether those users have access to your data is called authorization and it is handled through the security rules of your Firebase.

    So:

    Limiting access to your data to specific email addresses is certainly possible. I recommend that you read Firebase's documentation on the its security rules and try to make it work based on that. If you have any problems, post what you've tried and we'll be able to help you better.

    这篇关于将Firebase Google OAuth身份验证限制为特定用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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