什么原因导致Google云端硬盘应用程序请求获得“我不使用应用程序时执行这些操作”的权限 [英] What causes a Google Drive application to request permission to "Perform these operations when I'm not using the application"

查看:240
本文介绍了什么原因导致Google云端硬盘应用程序请求获得“我不使用应用程序时执行这些操作”的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

创建Google云端硬盘应用程序时,可以指定一些权限范围



其中一个权限:


当我不使用应用程序时执行这些操作

引起用户的很多关注。



我们可以想到的唯一可能性是使用OAuth2的服务器端流程意味着在浏览器关闭后服务器可能仍然在同步,因此必须将其标记出来。



如果是这种情况,将使用JS直接驱动器(无代理服务器)意味着这个权限不会被请求?

解决方案

这是由于您选择的OAuth2风格。



您可能采用了Web服务器流量特性,它使用参数 access_type = offline 构建授权URL。



这允许您获取刷新令牌,以便在用户使用应用程序后访问用户的文件。



您可以将此access_type参数替换为 access_type = online 但您不会获得刷新令牌。您将只能在一小时内访问用户的文件。之后,您将不得不申请一个新的访问令牌来访问他的文件。



我建议您阅读此页面解释每个流程。 官方规格也是很好的信息来源。


When creating Google Drive applications there are a number of permission "scopes" that can be specified to indicate to the users what permissions are required to run that application.

One of these permissions:

Perform these operations when I'm not using the application

Causes a lot of concern amongst our users. We could not find any definitive explanation of what causes this permission to be listed.

The only possibility we could think of is that using server-side flow for the OAuth2 means that the server might be still syncronising after the browser has been closed and so this has to be flagged up.

If that's the case, will using JS direct to Drive (no proxy server) mean that this permission will not be requested?

解决方案

This is due to the OAuth2 flavour you chose.

You probably have taken the web server flow flavour, which build a grant URL with the parameter access_type = offline.

This allows you to obtain a refresh token, so you can access your user's files after he has used your app.

You can replace this access_type paramater to access_type=online but you wont get a refresh token. You will be able to acces your users'files only for one hour. After that, you will have to request a new access token to access his files.

I encourage you to read this page where each of the flow are explained.

The official specifications are a good source of information too.

这篇关于什么原因导致Google云端硬盘应用程序请求获得“我不使用应用程序时执行这些操作”的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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