Forked from LindaLawton/GoogleAuthenticationCurl.sh
Created
February 5, 2018 11:27
-
-
Save nordringrayhide/44e2cea8d0fe28d14915853d0ee09839 to your computer and use it in GitHub Desktop.
Revisions
-
LindaLawton created this gist
Feb 16, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ # Client id from Google Developer console # Client Secret from Google Developer console # Scope this is a space seprated list of the scopes of access you are requesting. # Authorization link. Place this in a browser and copy the code that is returned after you accept the scopes. https://accounts.google.com/o/oauth2/auth?client_id=[Application Client Id]&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=[Scopes]&response_type=code # Exchange Authorization code for an access token and a refresh token. curl \ --request POST \ --data "code=[Authentcation code from authorization link]&client_id=[Application Client Id]&client_secret=[Application Client Secret]&redirect_uri=urn:ietf:wg:oauth:2.0:oob&grant_type=authorization_code" \ https://accounts.google.com/o/oauth2/token # Exchange a refresh token for a new access token. curl \ --request POST \ --data 'client_id=[Application Client Id]&client_secret=[Application Client Secret]&refresh_token=[Refresh token granted by second step]&grant_type=refresh_token' \ https://accounts.google.com/o/oauth2/token