I'm trying to integrate with one of Google Cloud REST APIs.
Using simple rest client I can generate short term API token using gcloud CLI:
curl -H "Authorization: Bearer $(gcloud config config-helper --format='value(credential.access_token)')" ....
I want to do it now with simple Java client... Of course - it's easy to perform REST calls using code. But how do I produce the API token?
I tried the instruction at the bottom of this page:
https://developers.google.com/identity/protocols/OAuth2ServiceAccount
But the generated token is not working well.