授权Google应用程序脚本 [英] Authorizing a Google apps script

查看:126
本文介绍了授权Google应用程序脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Google网站上集成Google应用脚本时,是否可以确保用户没有出现授权对话框?当该网站只在内部暴露时?

解决方案

如前所述,Apps Script原生应用程序Bean主要支持两种用例:
$ b


  • 作为部署用户执行:由于访问部署者的应用资源,最终用户无需授权

  • 作为最终用户执行:最终用户需要授权,因为访问最终用户的应用程序资源



支持您描述的第三个用例通过针对Google Apps API运行的Apps脚本的 URLFetchApp

在许多情况下,Apps API可以代表授权客户端(在这种情况下是Apps Script)有权执行的用户执行操作,因此如果客户端是授权使用管理员凭证,API通常可以代表最终用户执行操作,而最终用户不必授权Apps脚本来执行此操作。



不幸的是,您的用例,Gmail收件箱API似乎不是这些API之一。要监控其他最终用户收件箱信息, Gmail审核API 可能会遇到您的需要。


Is it possible to make sure that users are not presented with an Authorize dialog when integrating a Google apps script on a google site? when the site is only exposed internally?

解决方案

As mentioned, there are two use cases primarily supported by Apps Script native Apps beans:

  • Execute as deploying user: end users don't need to authorize since accesses deployer's Apps resources
  • Execute as end user: end users need to authorize since accesses end user's Apps resources

The third use case you're describing is supported by the Apps Script's URLFetchApp running against the Google Apps APIs.

In many cases the Apps APIs can perform operations on behalf of the user which the authorized client (in this case Apps Script) has authority to perform, so if the client is authorized with admin credentials, the API can often perform operations on behalf of the end user without the end user having to authorize Apps Script to do so.

Unfortunately for your use case, the Gmail Inbox API doesn't appear to be one of those APIs. For monitoring other end-user inbox information, the Gmail Audit API may meet your needs.

这篇关于授权Google应用程序脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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