简体   繁体   English

Firebase 禁止谷歌身份验证(权限被拒绝)

[英]Firebase Google authentication forbidden (permission denied)

i am currently using firebase to trying authenticate users with google.我目前正在使用 firebase 尝试使用谷歌验证用户身份。 I set up an angular project with my project1.我用我的项目 1 建立了一个 angular 项目。 While signing in anonymously into firebase, everything works as expected, if i change to signing in with google using the popup, it just breaks with the following error:匿名登录到 firebase 时,一切都按预期工作,如果我更改为使用弹出窗口登录谷歌,它只会因以下错误而中断:

{
  "error": {
    "code": 403,
    "message": "Requests from referer https://project1.firebaseapp.com/__/auth/iframe?apiKey=SECRET&appName=%5BDEFAULT%5D&v=7.13.2&usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en_GB.TVMmU0ureXg.O%2Fam%3DwQE%2Fd%3D1%2Fct%3Dzgms%2Frs%3DAGLTcCNEZ47O4XPxvOHlE2OsKBWeCQxiEw%2Fm%3D__features__ are blocked.",
    "errors": [
      {
        "message": "Requests from referer https://project1.firebaseapp.com/__/auth/iframe?apiKey=SECRET&appName=%5BDEFAULT%5D&v=7.13.2&usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en_GB.TVMmU0ureXg.O%2Fam%3DwQE%2Fd%3D1%2Fct%3Dzgms%2Frs%3DAGLTcCNEZ47O4XPxvOHlE2OsKBWeCQxiEw%2Fm%3D__features__ are blocked.",
        "domain": "global",
        "reason": "forbidden"
      }
    ],
    "status": "PERMISSION_DENIED"
  }
}

If i change my firebaseConfig from project1 to project2 (options like Google auth enabled, etc. are the same) it works properly.如果我将 firebaseConfig 从 project1 更改为 project2(启用 Google 身份验证等选项相同),它会正常工作。 Hence it can't be a client-issue.因此,这不可能是客户问题。 Same error occurs by running locally and hosting by firebase.在本地运行并由 firebase 托管会发生同样的错误。

I have absolutely no clue why is that, i am sure there has to be something obvious in the firebase settings which i just can't figure out yet.我完全不知道为什么会这样,我确信在 firebase 设置中一定有一些我无法弄清楚的明显的东西。 As far as i can tell, i changed all kinds of options on the firebase-platform itself.据我所知,我更改了 firebase 平台本身的各种选项。

To answer my own question: Go to google cloud console -> Credentials -> OAuth 2.0 Client IDs -> Select your project and add a 'Authorised redirect URI':回答我自己的问题:Go 到谷歌云控制台-> 凭据 -> OAuth 2.0 客户端 ID -> Select 你的项目并添加“授权重定向 URI”:

' https://myproject.web.app/ /auth/handler ' or ' https://myproject.firebaseapp.com/ /auth/handler ' ' https://myproject.web.app/ /auth/handler ' 或 ' https://myproject.firebaseapp.com/ /auth/handler '

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google 源回购拒绝权限 - Permission denied with Google source repo Firebase 9,混音:addDoc() 返回“PERMISSION DENIED”错误 - Firebase 9, Remix: addDoc() returns "PERMISSION DENIED" error 使用谷歌云 SDK Windows 10 上的身份验证方法获取 Git 推送到谷歌云源存储库的权限被拒绝(公钥) - Get Permission denied (publickey) for Git push to Google Cloud Source Repository with Google Cloud SDK authentication method on Windows 10 Firebase 实时数据库规则被拒绝权限 - Firebase Realtime Database Rules Denied Permission firebase-tools 错误:EACCES:权限被拒绝 - firebase-tools error: EACCES: permission denied 在模拟器套件中使用 Firebase AppCheck 时权限被拒绝 - PERMISSION DENIED when using Firebase AppCheck in emulator suite ERROR 错误:未捕获(承诺中):错误:权限被拒绝 Firebase - ERROR Error: Uncaught (in promise): Error: Permission denied Firebase 从谷歌云计算中提取 docker 的权限被拒绝 - Permission denied on docker pull from Google Cloud Compute 尝试使用 Ionic4 和 Angular 6 将文档添加到 firebase 时出错 - 错误:PERMISSION_DENIED:权限被拒绝 - Getting error when trying to add document to firebase using Ionic4 and Angular 6 - Error: PERMISSION_DENIED: Permission denied Firebase 身份验证和 google-service.json - Firebase authentication and google-service.json
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM