I’ve read Google’s documentation on integrating Firebase Cloud Messaging. Specifically, I’m writing the server part in Golang, using the firebase.google.com/go/v4 library. I’ve set everything up, but whenever I send a request, I always receive the message:
Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
In their documentation, they mention that “In place of the server key string used in legacy requests, HTTP v1 send requests require an OAuth 2.0 access token. If you are using the Admin SDK to send messages, the library handles the token for you. If you are using raw protocol, obtain the token as described in this section and add it to the header as Authorization: Bearer <valid Oauth 2.0 token>,” which means the authentication token should be automatically added. However, it seems it’s not working. Please help me with how to handle this issue.
Attempting to send a Firebase Cloud Message, but continuously encountering authentication error.
Center Internet Security is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.