【发布时间】:2022-12-29 15:03:15
【问题描述】:
我尝试在开发过程中同时使用 Firebase Appcheck 和 Emulator。我认为 Appcheck 在部署完成时可以工作,但在部署后也不起作用。但是,调试控制台在尝试将文件上传到存储时返回以下错误。
FirebaseError: AppCheck: Fetch server returned an HTTP error status. HTTP status: 403. (appCheck/fetch-status-error).
-
Appcheck for Firebase Storage:从 Firebase 控制台强制执行 - Appcheck
-
Storage.rules 如下:
service firebase.storage { match /b/{bucket}/o { match /{allPaths=**} { allow read, write: if request.auth!=null; } } }- 相关初始化代码
at the top of index.html body如下:
<script>self.FIREBASE_APPCHECK_DEBUG_TOKEN = true; initializeAppCheck(app , { provider: ReCaptchaV3Provider("My Recaptha V3 Site Key"), isTokenAutoRefreshEnabled: true, }); </script>-
main.dart中的AppCheck激活码如下:
await FirebaseAppCheck.instance.activate( webRecaptchaSiteKey: 'My Recaptha V3 Site Key', );- 我在激活的调试模式下激活 Auth 模拟器和存储模拟器。
await FirebaseAuth.instance.useAuthEmulator('localhost', 9099); await FirebaseStorage.instance.useStorageEmulator('localhost', 9199);如何摆脱错误?
- 相关初始化代码
【问题讨论】:
-
您是否将 AppCheck 调试令牌添加到 Firebase 控制台?
-
是的。我已将令牌添加到模拟器控制台提供的 Firebase 中。
-
你找到解决办法了吗?我有同样的问题
-
我现在还没有找到任何解决方案。
标签: firebase flutter recaptcha firebase-app-check