Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jamesbraza opened this issue Mar 22, 2020 · 2 comments
Labels

Comments

@jamesbraza
Copy link
Contributor

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?

@davidstrauss
Copy link
Owner

Hi. I'm not sure what you're doing wrong. Your steps look correct to me. I don't have time to figure this out myself, but I'd be happy to merge a PR with with better documentation on generating the client_secrets.json file if you do.

@tilusnet
Copy link

tilusnet commented Jul 3, 2020

I just want to confirm that I am in the exact same situation today as the OP. I have done very similar (if not identical) steps in getting the client_secrets.json file.

James, did you get any further with investigating this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants