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

查看:94
本文介绍了尝试匿名登录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:

(索引):64 {错误":{代码":403,消息":引荐来源的请求 https://myapp.firebaseapp.com/被阻止.",错误":[{"message":来自引荐人 https://myapp.firebaseapp.com/被阻止.",域":全局",原因":禁止"}],状态":"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"}}

但是,我认为我检查了所有环境中的所有内容是否相同:启用了匿名身份验证,并且我的Web应用程序位于Firebase Hosting上,因此代码应与环境无关.

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天全站免登陆