im currently having this error, is like when checking token adds an extra ‘/project’ at the beggining, and idk why.
FirebaseAppCheckError: The provided App Check token has incorrect "aud" (audience) claim. Expected "projects/my-project-ba978" but got "my-project-ba978". Make sure the App Check token comes from the same Firebase project as the service account used to authenticate this SDK.
Here is a piece of what im doing:
export async function GET(request) {
const userToGet = request.nextUrl.searchParams.get("uid");
const headersList = headers();
const appCheckToken = headersList.get("X-Firebase-AppCheck");
const appCheckClaims = await getAppCheck().verifyToken(appCheckToken);
console.log("appCheckClaims", appCheckClaims);
The token im passing in X-Firebase-AppCheck is the one I get from signInWithPopup
function from firebase/auth.
any suggestions?. Thanks in advance
What i did was logging in with signInWithPopup fn and used the retreived token to pass it to the getAppCheck fn and check it, what i want is to match tokens exactly, without the starting ‘/projects’. I also tried changing the project_id key in the json that google exports for you, adding a /projects initialy, but it ended receiving an ‘projects/projects/my-project-ba978’. Still not working
Christian de Diego is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.