I am implementing Firebase AppCheck in my Flutter app, and have followed the Firebase documentation to configure everything correctly. I have successfully obtained a token from my app, but when I try to validate it on the backend server, I receive the following error message:
"Firebase ID token has incorrect 'aud' (audience) claim. Expected 'myprojectid' but got 'projects/myprojectnumber,projects/myprojectid'. Make sure the ID token comes from the same Firebase project as the service account used to authenticate this SDK. See https://firebase.google.com/docs/auth/admin/verify-id-tokens for details on how to retrieve an ID token."
It says that it expected the project id but it got a list with the project id AND the project number, followed by the 'projects/'. I have double-checked all configuration files, for both Android, iOS and Flutter, and can confirm that the project ID and project number are correctly specified in separate fields. All those files are auto generated by the firebase console. Also, I do not have another project under my account. It seems strange that the 'aud' field of the JWT token is trying to pass both the project ID and project number in a list. Can anyone provide insights on why this might be happening and how I can resolve it? Thanks in advance for your help.