单个Google Drive API的多个Google帐户授权

问题描述 投票:1回答:1

我可以使用单个Google Drive API授权多个Google帐户吗?因为当我请求这个URI时

https://accounts.google.com/o/oauth2/v2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.metadata.readonly&access_type=offline&include_granted_scopes=true&state=teststate&redirect_uri=|+|redirecturi|+|&response_type=code&client_id=|+|clientid|+|

其中| + | redirecturi | + |和| + | clientid | + |替换为原始的,所以它直接将我重定向到redirect_uri而无需打开同意屏幕。

oauth google-api google-drive-sdk google-oauth
1个回答
0
投票

oauth2的工作方式是用户必须登录其Google帐户并授予您的应用程序访问其数据的权限。返回给您的访问令牌绑定到用于创建它的客户端ID。同意屏幕将显示给用户,代码将返回到重定向uri端点的应用程序

以下URL为用户构建同意表。

https://accounts.google.com/o/oauth2/auth?client_id= {的clientid} .apps.googleusercontent.com&REDIRECT_URI =瓮:IETF:WG:OAuth的:2.0:OOB&范围= https://www.googleapis.com/auth/analytics.readonly&response_type=code

enter image description here

在这种情况下,要求他们授予您的应用程序“google analytics windows”访问您的Google Analytcis帐户的权限。在用户看到此表单之前,他们必须登录。

回答:

可以同意您的申请的用户数量没有限制。应向每个用户显示同意屏幕并授予您的应用程序访问权限,您将被授予访问其数据的权限。

© www.soinside.com 2019 - 2024. All rights reserved.