Created
February 5, 2021 14:56
-
-
Save feroult/b8c88fe38ddea4c2637725cc6ae82a15 to your computer and use it in GitHub Desktop.
Id Token Google Cloud Build
This file contains 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
- name: gcr.io/cloud-builders/gcloud | |
entrypoint: "bash" | |
args: | |
- "-c" | |
- | | |
apt update && apt install jq -y | |
curl -X POST -H "content-type: application/json" \ | |
-H "Authorization: Bearer $(gcloud auth print-access-token)" \ | |
-d '{"audience": "dexinapp"}' \ | |
"https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/___SERVICE_ACCOUNT_EMAIL___:generateIdToken" | jq -r .token > /workspace/token.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment