gpt4 book ai didi

Firebase 应用检查 + 云功能 : Failed to validate AppCheck token

转载 作者:行者123 更新时间:2023-12-04 07:18:00 28 4
gpt4 key购买 nike

我最近在我的 Flutter 应用程序中添加了 Firebase App Check。
我正在使用 https.onCall() 调用 Cloud 函数方法。但是我收到此错误:

>  {"severity":"WARNING","message":"Failed to validate AppCheck token. FirebaseAppCheckError: Decoding App Check token failed. Make sure you passed the entire string JWT which represents the Firebase App Check token.
at FirebaseAppCheckError.FirebaseError [as constructor] (/Users/foxtom/Desktop/Cloud Functions/functions/node_modules/firebase-admin/lib/utils/error.js:44:28)
at FirebaseAppCheckError.PrefixedFirebaseError [as constructor] (/Users/foxtom/Desktop/Cloud Functions/functions/node_modules/firebase-admin/lib/utils/error.js:90:28)
at new FirebaseAppCheckError (/Users/foxtom/Desktop/Cloud Functions/functions/node_modules/firebase-admin/lib/app-check/app-check-api-client-internal.js:187:28)
at /Users/foxtom/Desktop/Cloud Functions/functions/node_modules/firebase-admin/lib/app-check/token-verifier.js:82:19
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
errorInfo: {
code: 'app-check/invalid-argument',
message: 'Decoding App Check token failed. Make sure you passed the entire string JWT which represents the Firebase App Check token.'
},
codePrefix: 'app-check'
}"}
> {"verifications":{"app":"INVALID","auth":"MISSING"},"logging.googleapis.com/labels":{"firebase-log-type":"callable-request-verification"},"severity":"WARNING","message":"Callable request verification failed: AppCheck token was rejected."}
严重性似乎只是警告,但它不执行该功能。我的函数只包含一个 console.log()在我的应用程序中,我有这个错误:
W/FirebaseContextProvider( 6788): Error getting App Check token; using placeholder token instead. Error: com.google.firebase.FirebaseException: Error returned from API. code: 403 body: App attestation failed.
I/flutter ( 6788): Error is : [firebase_functions/unauthenticated] Unauthenticated
我没有强制执行 documentation 中建议的任何操作
这阻止了我使用 Cloud Functions,我可以不再为我的应用程序禁用应用程序检查...
编辑 :
我补充说 Firebase StorageRealTime Database在没有强制执行时,没有任何调试 AppCheck token 就可以正常工作。
我能做什么 ?

最佳答案

我创建了一个可重现的代码示例,您可以在这里看到:https://github.com/nilsreichardt/playground/tree/firebase-app-check-cloud-function-unauthenticated-issue/firebase-app-check-cloud-functions-unauthentificated
因此,我在 FlutterFire 中创建了一个详细的问题。存储库 :https://github.com/FirebaseExtended/flutterfire/issues/6794
第一个解决方法已经发布为 comment我相信会有更多的变通方法或解决方案随之而来。

关于Firebase 应用检查 + 云功能 : Failed to validate AppCheck token,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68679583/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com