Google Drive API范围和文件访问(drive vs drive.files) [英] Google Drive api scope and file access (drive vs drive.files)

查看:420
本文介绍了Google Drive API范围和文件访问(drive vs drive.files)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我创建了两个刷新标记:
一个用于

  SCOPE ='https:// www .googleapis.com / auth / drive'

和另一个

  SCOPE ='https://www.googleapis.com/auth/drive.file'

我试图获取有关文件的信息(使用get方法)
使用SCOPE drive.files 时可以获得的一些文件,以及有些只在使用范围更广时 drive

但是我无法弄清楚是什么原因?

解决方案

不同之处在于'drive.file'只能提供给您对您的应用创建的文件或用户已明确与您的应用分享的文件的权限,而'drive'则为您的应用授予查看用户驱动器中所有文件的权限。



请参阅

https://developers.google.com/drive/web/scopes


I have created two refresh tokens for me: one for

SCOPE = 'https://www.googleapis.com/auth/drive'

and another

SCOPE = 'https://www.googleapis.com/auth/drive.file'

I'm trying to get information about files (using get method) Some files I can get when using SCOPE drive.files, and some only when using wider scope drive

But I can not figure out what is the reason for that? Files are located in different folders but have one shared root folder.

解决方案

The difference is that 'drive.file' only gives you permission to files that your app has created or the user has explicitly shared with your app, whereas 'drive' gives your app permission to see the all the files in the user's drive.

See

https://developers.google.com/drive/web/scopes

这篇关于Google Drive API范围和文件访问(drive vs drive.files)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆