acme-dns-01-googlecloud.js/oauth2l-test-token.sh

21 řádky
765 B
Bash
Surový Trvalý odkaz Normální zobrazení Historie

2019-07-23 07:12:46 +00:00
#!/bin/bash
# If your service_account.json is correct you should definitely be able to get a token
# using Google's official tool. If this fails, it will definitely fail with our own.
set -e
2019-07-24 02:39:46 +00:00
rm -f ~/.oauth2l
2019-07-23 07:12:46 +00:00
export GOOGLE_APPLICATION_CREDENTIALS=$HOME/Downloads/service_account.json
2019-07-24 02:39:46 +00:00
PROJECT=even-flight-244020
2019-07-23 07:12:46 +00:00
token=$(oauth2l fetch ndev.clouddns.readwrite)
2019-07-24 02:39:46 +00:00
echo API Token: $token
curl -fL "https://www.googleapis.com/dns/v1/projects/$PROJECT/managedZones" -H "Authorization: Bearer $token"
2019-07-23 07:12:46 +00:00
2019-07-24 02:39:46 +00:00
#token=$(oauth2l fetch --jwt ndev.clouddns.readwrite)
#token=$(oauth2l fetch --jwt https://www.googleapis.com/auth/ndev.clouddns.readwrite)
#echo JWT: $token
#curl -fL "https://www.googleapis.com/dns/v1/projects/$PROJECT/managedZones" -H "Authorization: Bearer $token"