在Google Apps脚本中实施OAuth时遇到困难(使用域范围委派) [英] Trouble Implementing OAuth in Google Apps Script (Using Domain-Wide Delegation)

查看:72
本文介绍了在Google Apps脚本中实施OAuth时遇到困难(使用域范围委派)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试运行以下示例中的示例Google Apps脚本服务帐户OAuth示例:
https://github.com/googlesamples/apps-script-oauth2/blob/master/samples/GoogleServiceAccount.gs 并继续收到服务器超时错误。我复制了确切的代码,并用私钥,客户端电子邮件和用户电子邮件代替。示例代码看起来是最新的,因为在7月30日有更新。



我已授权 https://www.googleapis。 com / drive / v2 / files 通过管理控制台以及 https://accounts.google.com/o/oauth2/token 和已经在管理设置中将它们列为范围(并且启用了域范围的委派)。我正在使用管理员帐户来运行脚本。



我不断收到无处不在的服务器超时错误,并且没有任何内容显示在执行日志中。

可能是什么问题?任何帮助,将不胜感激。谢谢你,提前。

解决方案

谢谢Gerardo,指引我朝着正确的方向前进。事实证明,我们的组织管理组织对Google开发者控制台的权限(在Google管理控制台中)。不知何故,包括我在内的几个帐户被退出了有权访问开发者控制台的组织。回来之后,样品没有问题。


I am trying to run the sample Google Apps Script Service Account OAuth example taken from here: https://github.com/googlesamples/apps-script-oauth2/blob/master/samples/GoogleServiceAccount.gs and keep getting a server timed-out error. I copied the exact code and just substituted in the private key, client email, and a user email. The example code looks to be current as there was an update to it on July 30th.

I have authorized https://www.googleapis.com/drive/v2/files through the admin console as well as https://accounts.google.com/o/oauth2/token and have listed these as scopes in the admin settings (and domain-wide delegation is enabled). I am using an admin account to run the script.

I keep getting the ubiquitious "Server Timed Out" error and nothing shows up in the Execution Logs.

What might be the problem? Any help would be appreciated. Thanks in advance.

解决方案

Thanks, Gerardo, for pointing me in the right direction. It turned out that our organization manages permissions for the Google Developer's Console by Organizations (in the Google Admin console). Somehow a few accounts, including mine, were kicked out of the Organization that had permissions to access the Developer's Console. After adding myself back in, the sample worked without problems.

这篇关于在Google Apps脚本中实施OAuth时遇到困难(使用域范围委派)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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