Created
September 10, 2020 23:21
-
-
Save mattes/3326768f5a7fb7185415d9a010261954 to your computer and use it in GitHub Desktop.
Get access token via curl for default service account on Google Cloud Compute Engine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
METADATA=http://metadata.google.internal/computeMetadata/v1 | |
SVC_ACCT=$METADATA/instance/service-accounts/default | |
ACCESS_TOKEN=$(curl -H 'Metadata-Flavor: Google' $SVC_ACCT/token | cut -d'"' -f 4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment