Reputation: 223
Is there any way to embed or access Google Apps Script in a Gmail Contextual Gadget? I need to access the Apps Script API functionality from a Gmail contextual gadget.
I created a test web service and it returns my corporate single signon page (SAML with Google) instead of "Hello World" when called from wget.
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=......
Upvotes: 2
Views: 858
Reputation: 12673
It should be possible, as someone has used Apps Script as a data source for a calendar gadget (see here). In your case you are getting a login screen because you published your web app in such a way that doesn't allow for anonymous access, and wget isn't passing along your cookies.
Upvotes: 1