Skip to content

Getting "Insufficient permissions for this file" - what is correct way to create client_secrets.json? #31

@jamesbraza

Description

@jamesbraza

I am trying to use this tool, and so far I think it's pretty nifty. I am struggling with what I believe to be a client_secrets.json problem. When running transfer.py, it tries to update ownership permissions of a .jpg file, and fails with the below message:

An error occurred updating ownership permissions: <HttpError 403 when requesting https://www.googleapis.com/drive/v2/files/10-some_text/permissions/some_numbers?transferOwnership=true&alt=json returned "Insufficient permissions for this file">

Based on this Stack Overflow question, it seems I may have my client_secrets.json permissioning all wrong.

I see from within transfer.py it wants to use Drive API v2, and the OAuth2 scope https://www.googleapis.com/auth/drive.

Here is how I generated my client_secrets.json:

  1. Went to https://console.developers.google.com/
  2. Made a project
    • Project name: "xyz" (not the real name)
    • Project ID: went with autogenerated ID
    • Location: No organization
  3. Went to https://console.developers.google.com/apis/library
  4. Enabled Google Drive API
  5. Went to https://console.developers.google.com/apis/credentials/consent
  6. Made an OAuth consent screen
    • Application name: "abc" (not the real name)
    • Support email: my email
    • Left everything else as default
  7. Went to https://console.developers.google.com/apis/credentials/wizard
    • Which API? Google Drive API
    • Where? Other UI
    • What data? User data
  8. It took me to a "Create an OAuth 2.0 client ID" page
    • Name: test-client-id (not the real name)
  9. I hit the Download button --> downloaded client_id.json
{
    "installed": {
        "client_id": "some_number-some_text.apps.googleusercontent.com",
        "project_id": "xyz",
        "auth_uri": "https://accounts.google.com/o/oauth2/auth",
        "token_uri": "https://oauth2.googleapis.com/token",
        "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
        "client_secret": "some_secret",
        "redirect_uris": ["urn:ietf:wg:oauth:2.0:oob", "http://localhost"]
    }
}
  1. I copied that file contents over the previous client_secrets.json
  2. And I ran the transfer.py script and got the above warning

What am I doing wrong in generating the client_secrets.json? Can anyone advise?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions