Creating an OAuth Client ID

Overview

This document will take you through the steps needed to set up a Google Cloud project and create an OAuth client ID for gphoto-sync.

For a discussion of the purpose of this ID see Google OAuth Tokens for gphotos-sync.

Each step here assumes that you’re logged into a personal Google account.

Note

The steps outlined here are correct as of May 2022. Their is quite a bit of churn in the Google Cloud Console UI so the screens may change a bit.

Create a Google Cloud Project

  1. Head to https://console.cloud.google.com

    • If you have not set up Google Cloud before, select your country and agree the to the Terms of Service.

    ../_images/0.png
  2. In the top banner the currently selected project is shown. If you have no previous projects this will say ‘Select a project’

    • Click on the current project name or ‘Select a project’

    • This will bring up the ‘Select a Project’ dialog

    ../_images/1.png
  3. Press New Project.

  4. Enter a project name. For example, “gphotos”. This name must be unique within your account and cannot be changed in the future.

  5. Leave Location as the default “No Organization”.

  6. Press Create.

    ../_images/2.png

Enable the Photos API

  1. Ensure that the project you made above is the active project.

  2. Click on the top-left hamburger menu and find APIs & Services > Library.

    ../_images/3.png
  3. Search for the Photos Library API by Google and select it.
    ../_images/4.png
  4. Enable it.

    ../_images/5.png

Create the OAuth Credentials

  1. Find APIs & Services > Credentials

  2. Press + Create Credentials and select OAuth client ID.

    ../_images/12-create_creds.png
  3. Choose Desktop App
    1. Choose name for your credentials e.g. gphotos

    2. Click Create

    ../_images/14-create_id.png
  4. Click Download JSON to download the OAuth client ID as JSON and save it as client_secret.json.

    ../_images/15-created.png

Publish the App

Important

Failure to publish the app will result in your auth token expiring after 7 days. See the Google Cloud docs and Issue #290 for details.

  1. Head to APIs & Services > OAuth consent screen

  2. Press Publish App.

  3. Read the notice and press Confirm.

At this point you should be able to run gphotos-sync using the instructions found in the README.

Move client_secret.json

  1. The client_secret.json must be moved to the correct location

  2. Each supported operating system has a different location where it will look for this file.

  3. Return the Initial Setup for details of where to put this file.