2

有没有办法在 Gmail 上下文小工具中嵌入或访问 Google Apps 脚本?我需要从 Gmail 上下文小工具访问 Apps Script API 功能。

我创建了一个测试 Web 服务,当从 wget 调用时,它返回我的公司单点登录页面(使用 Google 的 SAML)而不是“Hello World”。

function doGet(e) {
  var output = ContentService.createTextOutput();
  output.setContent("Hello world");
  return output;
}

$ wget https://script.google.com/a/macros/example.com/s/AKfycbz-aVKchJk3AQltnd5CKabbGJawCu0U3ySChcT5QxBNWBS_FoU/exec
--2012-08-31 14:37:03--  https://script.google.com/a/macros/example.com/s/AKfycbz-aVKchJk3AQltnd5CKabbGJawCu0U3ySChcT5QxBNWBS_FoU/exec
Resolving script.google.com... 74.125.225.97, 74.125.225.99, 74.125.225.110, ...
Connecting to script.google.com|74.125.225.97|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://www.google.com/a/example.com/ServiceLogin?service=wise&passive=1209600&continue=https://script.google.com/a/macros/example.com/s/AKfycbz-aVKchJk3AQltnd5CKabbGJawCu0U3ySChcT5QxBNWBS_FoU/exec&followup=https://script.google.com/a/macros/example.com/s/AKfycbz-aVKchJk3AQltnd5CKabbGJawCu0U3ySChcT5QxBNWBS_FoU/exec [following]
--2012-08-31 14:37:03--  https://www.google.com/a/example.com/ServiceLogin?service=wise&passive=1209600&continue=https://script.google.com/a/macros/example.com/s/AKfycbz-aVKchJk3AQltnd5CKabbGJawCu0U3ySChcT5QxBNWBS_FoU/exec&followup=https://script.google.com/a/macros/example.com/s/AKfycbz-aVKchJk3AQltnd5CKabbGJawCu0U3ySChcT5QxBNWBS_FoU/exec
Resolving www.google.com... 209.85.225.147, 209.85.225.104, 209.85.225.105, ...
Connecting to www.google.com|209.85.225.147|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://extsignon.example.com:443/amserver/SSORedirect/metaAlias/emplFed/idp?SAMLRequest=......
4

1 回答 1

1

这应该是可能的,因为有人使用 Apps 脚本作为日历小工具的数据源(请参阅此处)。在您的情况下,您将获得一个登录屏幕,因为您以不允许匿名访问的方式发布了您的网络应用程序,并且 wget 没有传递您的 cookie。

于 2012-09-05T16:50:13.023 回答