Hello,
I want to get the access token for an attached service account without using a Google auth library.
Referring to AIP-4115, I am able to obtain an access token by making a request to the metadata server:
curl -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token
Output resembles the following:
{ "access_token": "...", "expires_in": 3599, "token_type": "Bearer" }
My question is: Is there a rate limit for these requests?
Other relevant background and research:
Access tokens expire after a short period of time. The metadata server caches access tokens until they have 5 minutes of remaining time before they expire. You can request new tokens as frequently as you like, but your applications must have a valid access token for their API calls to succeed.
Solved! Go to Solution.
There is no rate limits other than what the Metadata Server can handle. In a normal situation, you should not have any issues with that.