google-drive-recursive-ownership
google-drive-recursive-ownership copied to clipboard
Getting "Insufficient permissions for this file" - what is correct way to create client_secrets.json?
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:
- Went to https://console.developers.google.com/
- Made a project
- Project name: "xyz" (not the real name)
- Project ID: went with autogenerated ID
- Location: No organization
- Went to https://console.developers.google.com/apis/library
- Enabled Google Drive API
- Went to https://console.developers.google.com/apis/credentials/consent
- Made an OAuth consent screen
- Application name: "abc" (not the real name)
- Support email: my email
- Left everything else as default
- Went to https://console.developers.google.com/apis/credentials/wizard
- Which API? Google Drive API
- Where? Other UI
- What data? User data
- It took me to a "Create an OAuth 2.0 client ID" page
- Name: test-client-id (not the real name)
- 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"]
}
}
- I copied that file contents over the previous
client_secrets.json - And I ran the
transfer.pyscript and got the above warning
What am I doing wrong in generating the client_secrets.json? Can anyone advise?
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.
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?