Create OAuth2 Credentials

Steps

  1. Create a project in Google Cloud Console:
    1. Go to the Google Cloud Console.
    2. Create a new project or select an existing project.
  2. Enable the Google Drive, Drive Labels, and Admin SDK API:
    1. In the Google Cloud Console, navigate to the APIs & Services > Library.
    2. Search for Google Drive API and click on it.
    3. Click the Enable button to enable the Google Drive API for the project.
    4. Search for Admin SDK API and click on it.
    5. Click the Enable button to enable the Admin SDK API for the project.
    6. Search for Drive Labels API and click on it.
    7. Click the Enable button to enable Drive Labels API for the project.
  3. Create OAuth 2.0 Credentials:
    1. In the Google Cloud Console, go to APIs & Services > Credentials.
    2. Click Create credentials and select Service account.
    3. Enter a name in the Service account name field and click CREATE CREDENTIALS.
    4. Under Grant this service account access to the project select role as Owner and click DONE.
    5. Select the newly created service account and click Keys > Add Key > Create new key.
    6. Make sure the key type is set to json and click CREATE >
    7. The new private key pair is generated and downloaded to the machine. Note the values of private_key, client_email and client_id.