October 8, 2015

Generate Google API refresh token

You can generate Google API refresh token manually in browser. Once you get the refresh token, you start using Google API services.

Follow below steps to generate refresh token

Step 1: Login into Google account in chrome browser

Step 2: Just change your input in below URL and paste it in browser.

https://accounts.google.com/o/oauth2/auth?client_id=CLIENT_ID&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=SCOPE1%20SCOPE2&response_type=code&access_type=offline

Step 3: Once you press Go/Enter you will get Authorization code.

Step 4: If you have not curl utility, just download it.  Go to command window hit below URL after replacement of your values.

Curl https://accounts.google.com/o/oauth2/token -d "code=AUTHCODE&client_id=CLIENT_ID&client_secret=CLIENT_SECRET&grant_type=authorization_code"

AUTHCODE = value you got in previous step.

You will get refresh token as response. Now you can use refresh token in your service.

No comments:

Post a Comment