I am trying to validate an AppCheck DEBUG token generated following the directions of the documentation here: https://firebase.google.com/docs/app-check/flutter/debug-provider?hl=en&authuser=0
I created a debug token using the "Generate token" button on one of my registered apps which resulted in a token that looks like this: 9DE9100-A019-4AB6-AMS9-FD5SD10925DD.
However, anytime I try to verify it on my backend with
const res = await admin.appCheck().verifyToken(req.header('X-Firebase-AppCheck'));
I get the following error thrown:
FirebaseAppCheckError: Decoding App Check token failed. Make sure you passed the entire string JWT which represents the Firebase App Check token.
{
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'
}
I've tried sending this token from a Postman request, and implemented a mocha test in my code, but both fail equally. The only thing I can think of, is that the token wasn't generated by the SDK in my app, but rather using the Generate Token button, but I don't see why that should matter.
Any ideas as to what I might be doing wrong?