Last active
November 21, 2016 14:06
-
-
Save pluto-atom-4/89f22490804c412ded8f662e6f003acf to your computer and use it in GitHub Desktop.
utilizing google cloud service account
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
group 'internal.example' | |
version '1.0-SNAPSHOT' | |
apply plugin: 'java' | |
sourceCompatibility = 1.8 | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
compile group: 'com.google.http-client', name: 'google-http-client-jackson2', version: '1.22.0' | |
compile group: 'com.google.oauth-client', name: 'google-oauth-client', version: '1.22.0' | |
compile group: 'com.google.api-client', name: 'google-api-client-appengine', version: '1.22.0' | |
compile group: 'log4j', name: 'log4j', version: '1.2.16' | |
compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.7' | |
testCompile group: 'junit', name: 'junit', version: '4.12' | |
} |
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
it_token_string=$1 | |
# ref. https://developers.google.com/identity/protocols/OAuth2ServiceAccount#authorizingrequests | |
curl -d "grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=${id_token_string}" \ | |
https://www.googleapis.com/oauth2/v4/token | |
# ref. http://stackoverflow.com/questions/30780407/google-oauth2-jwt-token-verification-exception | |
curl https://www.googleapis.com/oauth2/v2/tokeninfo?id_token=$id_token_string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment