启用Firebase AppCheck之后,App无效(403错误)

发布于 2025-02-04 09:34:08 字数 1139 浏览 4 评论 0原文

我遵循了启用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文