I'm getting a 401 Unauthorized error from Firebase when testing out my iOS app with the FirebaseAuth package using a cloud function. I am including the result of getIDTokenResult(forcingRefresh: true).token (which is returning a token that looks valid) in the "Authorization": "Bearer" header, which looks right when examining.
I have tried using Postman and it also doesn't work when using the token that getIDTokenResult(forcingRefresh: true).token provides, but it does work when I use gcloud auth print-identity-token to get my own token.
So it seems that getIDTokenResult(forcingRefresh: true).token is returning a token that looks valid but is not actually valid, or I have a misconfiguration of my Firebase project. Any ideas on how I could troubleshoot?