尝试匿名登录 Firebase 时,对引荐来源的请求被阻止 [英] Requests for referrer are blocked when trying to sign in anonymously to Firebase

查看:27
本文介绍了尝试匿名登录 Firebase 时,对引荐来源的请求被阻止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 JS SDK 从 Web 应用匿名登录,它在某些环境中运行良好,但在一个环境中,在其他地方运行的完全相同的代码给了我 403:

I’m trying to sign in anonymously from a Web app using the JS SDK and it works great on some environments, but on one environment, the exact same code that’s working elsewhere is giving me a 403:

(index):64 {error":{code":403,message":来自引用者的请求 https://myapp.firebaseapp.com/ 被阻止.,"errors":[{message":来自引用者的请求 https://myapp.firebaseapp.com/ 被屏蔽.,"domain":global",reason":forbidden"}],status":PERMISSION_DENIED"}}

(index):64 {"error":{"code":403,"message":"Requests from referer https://myapp.firebaseapp.com/ are blocked.","errors":[{"message":"Requests from referer https://myapp.firebaseapp.com/ are blocked.","domain":"global","reason":"forbidden"}],"status":"PERMISSION_DENIED"}}

但我想我检查了所有环境中的一切都相同:启用匿名身份验证并且我的网络应用程序在 Firebase 托管上,因此代码应该与环境无关.

Yet I think I checked everything is the same in all environments: anonymous authentication is enabled and my web app is on Firebase Hosting so the code should be environment-independent.

知道这可能来自哪里吗?

Any idea where else this could come from?

推荐答案

您似乎对 API 密钥设置了一些引用限制.您需要转到 Google Cloud Console 并修改对 API 密钥的这些限制.

It seems like you have set some referrer restrictions on your API key. You need to go to the Google Cloud Console and modify these restrictions on your API key.

这篇关于尝试匿名登录 Firebase 时,对引荐来源的请求被阻止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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