'FirebaseError: AppCheck: Fetch server returned an HTTP error status. HTTP status: 403. (appCheck/fetch-status-error)
I try to use Firebase Appcheck and Emulator together during development process. I thought that Appcheck can work when deployment completed but it doesn't work after deployment too. However,debug console return below error when It try to upload a file to the storage.
FirebaseError: AppCheck: Fetch server returned an HTTP error status. HTTP status: 403. (appCheck/fetch-status-error).
Appcheck for Firebase Storage : Enforced from Firebase Console - Appcheck
Storage.rules is as follows:
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if request.auth!=null;
}
}
}
- Related initialization code
at the top of index.html body
as follows:
<script>self.FIREBASE_APPCHECK_DEBUG_TOKEN = true;
initializeAppCheck(app , {
provider: ReCaptchaV3Provider("My Recaptha V3 Site Key"),
isTokenAutoRefreshEnabled: true,
});
</script>
- AppCheck activating code in
main.dart
as follows:
await FirebaseAppCheck.instance.activate(
webRecaptchaSiteKey: 'My Recaptha V3 Site Key',
);
- I activate AuthEmulator and StorageEmulator when debug mode activated.
await FirebaseAuth.instance.useAuthEmulator('localhost', 9099);
await FirebaseStorage.instance.useStorageEmulator('localhost', 9199);
How to get rid of the error ?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|