Skip to content

httpsCallable expect app check token although api was not enabled #8469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nes123 opened this issue Apr 14, 2025 · 8 comments
Open

httpsCallable expect app check token although api was not enabled #8469

nes123 opened this issue Apr 14, 2025 · 8 comments

Comments

@nes123
Copy link

nes123 commented Apr 14, 2025

after the last update ("@react-native-firebase/functions": "21.13.0") i get an error only when Android app calling a firebase function. The error in the server side:

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

Error is not expected as app check is disabled in my project.

@MichaelVerdon
Copy link
Collaborator

Hello there, can you please provide more information such as the logs and maybe a snippet?

@nes123
Copy link
Author

nes123 commented Apr 14, 2025

Hello there, can you please provide more information such as the logs and maybe a snippet?

Here are some more details. My firebase function looks like that:

exports.myFunction = functions.https.onCall(async (data, context) => {});

i didnt include:

.runWith({
enforceAppCheck: true, // Reject requests with missing or invalid App Check tokens.
})

When i call it from the react native app:

Firebase.functions
.httpsCallable("myFunction")

when calling using react-native-firebase 21.10.0 everything works fine for both ios and android

after upgrading to 21.13.0 it still works well for ios, but when calling the function from android device i get on the server side:

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] (/layers/google.nodejs.yarn/yarn_modules/node_modules/firebase-admin/lib/utils/error.js:44:28)
at FirebaseAppCheckError.PrefixedFirebaseError [as constructor] (/layers/google.nodejs.yarn/yarn_modules/node_modules/firebase-admin/lib/utils/error.js:90:28)
at new FirebaseAppCheckError (/layers/google.nodejs.yarn/yarn_modules/node_modules/firebase-admin/lib/app-check/app-check-api-client-internal.js:187:28)
at /layers/google.nodejs.yarn/yarn_modules/node_modules/firebase-admin/lib/app-check/token-verifier.js:81:19
at processTicksAndRejections (internal/process/task_queues.js:95: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'
}

@MichaelVerdon
Copy link
Collaborator

Hi there, thank you for the information. What version were you using before you updated? What I am wondering is if you were using a React Native Firebase version that wrapped around an earlier version of the Native SDKs. App-Check was not changed here in the last update and I assume you are calling app check related functions with your firebase functions? I would also like to ask for more details about what your function is doing and what method it is calling?

@nes123
Copy link
Author

nes123 commented Apr 14, 2025

Hi there, thank you for the information. What version were you using before you updated? What I am wondering is if you were using a React Native Firebase version that wrapped around an earlier version of the Native SDKs. App-Check was not changed here in the last update and I assume you are calling app check related functions with your firebase functions? I would also like to ask for more details about what your function is doing and what method it is calling?

I was using 21.10.0 before. I dont do anything related to app check in the client nor in the server side. I assume that after upgrade the client is sending an empty token and the firebase admin is trying to authenticate it. Maybe it is related to a change they did in the android SDK.

I just noticed that i get this warning when my app starts:

Error getting App Check token; using placeholder token instead. Error: com.google.firebase.FirebaseException: No AppCheckProvider installed.

@nes123
Copy link
Author

nes123 commented Apr 14, 2025

i updated the firebase-admin and firebase-functions and re-deployed the function and it seems to solve the problem..but i still get many warnings about No AppCheckProvider installed

@MichaelVerdon
Copy link
Collaborator

Hey there @nes123 glad to hear this fixed your issue, it must have been version incompatibility until you upgraded your admin. What warning do you get? Depending on what it is it could be safe to ignore.

@nes123
Copy link
Author

nes123 commented Apr 14, 2025

Hey there @nes123 glad to hear this fixed your issue, it must have been version incompatibility until you upgraded your admin. What warning do you get? Depending on what it is it could be safe to ignore.

This is the warning:

Error getting App Check token; using placeholder token instead. Error: com.google.firebase.FirebaseException: No AppCheckProvider installed.

we are worried it might cause other issues..not just with functions..

@mikehardy
Copy link
Collaborator

@nes123 best answers I see from a broad search are to make sure you haven't overridden the firebase-android-sdk or firebase-ios-sdk versions anywhere, so you are getting up to date versions (that one came from FlutterFire) and to make sure that you've got your android package name specified correctly + enforced correctly in GCP / Firebase console (that one from stackoverflow). In general I don't think it's a problem with react-native-firebase in other words, all related commentary on the internet and from what I know is that it's some sort of project-specific config issue, though it is probably a subtle one...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants