Created
October 5, 2012 00:14
-
-
Save jimryan/3837269 to your computer and use it in GitHub Desktop.
GCP Authenticator Script
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
#!/bin/bash | |
echo -n "Client ID: " | |
read client_id | |
echo -n "Client secret: " | |
read client_secret | |
echo -n "Redirect URI: " | |
read redirect_uri | |
open "https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=$client_id&redirect_uri=$redirect_uri&access_type=offline&scope=https://www.googleapis.com/auth/cloudprint" | |
echo -n "Authorization code (from browser): " | |
read authorization_code | |
curl -d "code=$authorization_code&client_id=$client_id&client_secret=$client_secret&redirect_uri=$redirect_uri&grant_type=authorization_code" https://accounts.google.com/o/oauth2/token |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment