启用Firebase AppCheck之后,App无效(403错误)
我遵循了启用AppCheck的官方指南。我注册了我的网站以进行recaptcha v3,并注册了我的应用程序在Firebase控制台中使用AppCheck。我还没有执行任何执行。
在我的一个ngmodules中,我做了以下操作:
import {
initializeAppCheck,
ReCaptchaV3Provider,
provideAppCheck,
} from "@angular/fire/app-check";
...
provideAppCheck(() => {
return initializeAppCheck(getApp(), {
provider: new ReCaptchaV3Provider(environment.firebase.recaptchaKey),
isTokenAutoRefreshEnabled: true,
});
}),
完成上面提到的事情后,我的应用程序不再起作用。我的网站加载时会遇到以下错误:
Could not reach Cloud Firestore backend. Connection failed 1 times. Most recent error: FirebaseError: [code=unknown]: Fetching auth token failed: AppCheck: Fetch server returned an HTTP error status. HTTP status: 403. (appCheck/fetch-status-error).
不时打印此错误:
Unhandled Promise rejection: cancelled ; Zone: <root> ; Task: Promise.then ; Value: cancelled undefined
在AppCheck API监视下的Firebase控制台中,所有请求均标记为未经验证的未经验证:过时的客户端请求
在Google中recaptcha admin Console,它说总计请求0。
上面发生在我的应用程序的部署版本上,我在Google Recaptcha Admin Console的设置中列出了该域。
有什么问题?我该如何调试?
I followed the official guide to enable AppCheck. I registered my site for reCAPTCHA v3 and registered my app to use AppCheck in the firebase console. I have not yet enforced anything.
In one of my NgModules I did the following:
import {
initializeAppCheck,
ReCaptchaV3Provider,
provideAppCheck,
} from "@angular/fire/app-check";
...
provideAppCheck(() => {
return initializeAppCheck(getApp(), {
provider: new ReCaptchaV3Provider(environment.firebase.recaptchaKey),
isTokenAutoRefreshEnabled: true,
});
}),
After doing what I've mentioned above, my app no longer works. I get the following error once when my site loads:
Could not reach Cloud Firestore backend. Connection failed 1 times. Most recent error: FirebaseError: [code=unknown]: Fetching auth token failed: AppCheck: Fetch server returned an HTTP error status. HTTP status: 403. (appCheck/fetch-status-error).
And this one is printed from time to time:
Unhandled Promise rejection: cancelled ; Zone: <root> ; Task: Promise.then ; Value: cancelled undefined
In the firebase console under AppCheck API monitoring, all requests are marked as Unverified: outdated client requests
In the google recaptcha admin console, it says total requests 0.
The above happens on a deployed version of my app whose domain I have listed in the settings of the google recaptcha admin console.
What could be the issue? How do I debug it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论