I have a cloud run web service (flask) hosted on GCP, I can make GET requests to this server from my terminal using curl
curl --header "Authorization: Bearer $(gcloud auth print-identity-token)" SERVICE_URL
Which works, I am trying to do the same thing in Node.js using the fetch function, i.e:
fetch(SERVICE_URL)
.then((response) => response.json())
.then((data) => resolve(data.total))
.catch(error => alert('Error! ' + error.message))
However, I am getting a 403, how do I authenticate with my service on GCP?