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

时间:2012-08-31 19:02:36

标签: gmail google-apps-script

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

我创建了一个测试网络服务,当从wget调用时,它返回我的公司单点登录页面(SAML with Google)而不是“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=......

1 个答案:

答案 0 :(得分:1)

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