Embed Google Photos

  1. Home
  2. Docs
  3. Embed Google Photos
  4. Guides
  5. Get Refresh Token

Get Refresh Token

How to easily get a refresh token is shown below. Please follow the steps below:

  • In the step to create a client ID, add an additional “Authorized Redirect URI”:
    • https://developers.google.com/oauthplayground
  • Now go to the Google OAuth2 Playground. This is a site hosted by Google to help you do your validations. Click on the Settings icon:
Embed Google Photos- Settings Icon
Embed Google Photos- Settings Icon
  • Select the option to “Use your own OAuth credentials”, and provide the “OAuth Client ID” and “OAuth Client secret” that you obtained in the step to create a client ID. Click “Close” once you are done
Embed Google Photos- Provide your own credentials
Embed Google Photos- Provide your own credentials
  • On the left, under the section that says “Select & authorize APIs”, you will see a box that says “Input your own scopes”. Put in https://www.googleapis.com/auth/photoslibrary.readonly https://www.googleapis.com/auth/photoslibrary.sharing. Note that there are two URLs, separated by a space. Click “Authorize APIs”.
Embed Google Photos- Add Scopes
Embed Google Photos- Add Scopes
  • You will then be brought back to the OAuth 2.0 Playground. You will see and authorization code and an option to “Exchange authorization code for tokens”. Click on it
Embed Google Photos- Exchange The Token
Embed Google Photos- Exchange The Token
  • You will finally see Google provide you with a “Refresh token” and an “Access token”. Copy the “Refresh token”:
Embed Google Photos- Copy Refresh Token
Embed Google Photos- Copy Refresh Token
Was this article helpful to you?

How can we help?