哪些Google API支持OAuth2域范围委派? [英] Which Google APIs support OAuth2 Domain-Wide Delegation?

查看:332
本文介绍了哪些Google API支持OAuth2域范围委派?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前正在尝试转而使用OAuth1 2LO(2 Legged OAuth)中的OAuth2。起初,由于我们严重依赖2LO,几乎所有的产品API(Drive除外)都在他们的文档中包含以下信息,所以我们似乎无法完成此举:


如果您的应用程序具有某些异常授权要求,例如在请求数据访问(混合)或全域范围授权(2LO)的同时登录,则您目前不能使用OAuth 2.0令牌。在这种情况下,您必须使用OAuth 1.0令牌和API密钥。
- https://developers.google.com/google-apps/calendar/ auth


一些较新的API(如Admin SDK API)也具有相同的消息。

在查看云端硬盘委派文件时: https: //developers.google.com/drive/delegation ,它明确地谈到了使用域范围的日历代理:


在一个或多个API范围字段中,输入您的应用程序应该被授予访问权的范围列表(请参见下图)。例如,如果您需要在全域范围内访问Google Drive API和Google Calendar API,请输入: https:// www.googleapis.com/auth/drive https://www.googleapis.com/auth /日历


这似乎与日历授权文档直接相抵触。有人知道哪些其他API支持域范围委派吗?

解决方案

所有通过Google的双腿OAuth2获取的令牌Google API。有关如何提供域范围委派的更多信息,请参阅 Google的双腿OAuth2 Google Drive SDK委托文档。



日历文档看起来已经过时了,但我们应该尽快更新它。



希望有帮助!


Currently in the process of trying to move over to use OAuth2 from of OAuth1 2LO (2 Legged OAuth). At first it looked like we would not be able to make the move as we rely heavily on 2LO and almost all of the product APIs (with the exception of Drive) have this message in their docs:

If your application has certain unusual authorization requirements, such as logging in at the same time as requesting data access (hybrid) or domain-wide delegation of authority (2LO), then you cannot currently use OAuth 2.0 tokens. In such cases, you must instead use OAuth 1.0 tokens and an API key. - https://developers.google.com/google-apps/calendar/auth

Some of the newer APIs (like the Admin SDK APIs) also have the same message.

While looking at the Drive Delegation Document: https://developers.google.com/drive/delegation, it explicitly talks about using domain-wide delegation for calendar:

In the One or More API Scopes field enter the list of scopes that your application should be granted access to (see image below). For example if you need domain-wide access to the Google Drive API and the Google Calendar API enter: https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/calendar

This seems to directly contradict the calendar auth doc. Does anyone know which other APIs support Domain-Wide Delegation?

解决方案

Access tokens obtained through Google's 2-legged OAuth2 are supported by all Google APIs. For more info on how to provide domain-wide delegation, see Google's 2-legged OAuth2 and Google Drive SDK delegation docs.

The calendar documentation seems out-of-date indeed, we should have it updated soon though.

Hope that helps!

这篇关于哪些Google API支持OAuth2域范围委派?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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