Skip to content
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.

Access to the whole Drive not allowed #18

Open
mvysny opened this issue Dec 20, 2017 · 1 comment
Open

Access to the whole Drive not allowed #18

mvysny opened this issue Dec 20, 2017 · 1 comment

Comments

@mvysny
Copy link

mvysny commented Dec 20, 2017

I'm trying to use this API to access all files on user's Drive, but it is not possible:

  1. Using Drive.SCOPE_FILE only lists New Folder as a child of the root folder (client.rootFolder)
  2. Using just Scope("https://www.googleapis.com/auth/drive.readonly") fails with:
java.lang.IllegalArgumentException: You must request a Drive scope in order to interact with the Drive API.
       at com.google.android.gms.common.internal.zzbq.checkArgument(Unknown Source)
       at com.google.android.gms.drive.Drive.zza(Unknown Source)
       at com.google.android.gms.drive.Drive.getDriveResourceClient(Unknown Source)
  1. Using both scopes: requestScopes(Drive.SCOPE_FILE, Scope("https://www.googleapis.com/auth/drive.readonly")) seems to ignore the latter one and still only lists the New Folder
@mvysny
Copy link
Author

mvysny commented Dec 20, 2017

  1. Passing the scope of https://www.googleapis.com/auth/drive (the full access rights) fails with an exception:
E/ClientConnectOperation: Handling authorization failure
                                                          nzh: Authorization failed: Unsupported scope: https://www.googleapis.com/auth/drive
                                                              at nzl.a(:com.google.android.gms@11951448:25)
                                                              at nvy.<init>(:com.google.android.gms@11951448:26)
                                                              at nxh.a(:com.google.android.gms@11951448:72)
                                                              at swi.run(:com.google.android.gms@11951448:11)
                                                              at mvc.run(:com.google.android.gms@11951448:26)
                                                              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
                                                              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
                                                              at nak.run(:com.google.android.gms@11951448)
                                                              at java.lang.Thread.run(Thread.java:761)

Is there a way to access all files in user's Google Drive with this API?

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

No branches or pull requests

1 participant