1
votes

I'm deploying an in-house Gmail contextual gadget from an existing code. Have deployed the gadget in my google apps domain by refering this document : https://developers.google.com/apps-marketplace/preparing

function makeRequest(){
    var params = {};
    params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET;
    params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.TEXT;
    params[gadgets.io.RequestParameters.AUTHORIZATION] = gadgets.io.AuthorizationType.SIGNED;
    params[gadgets.io.RequestParameters.OAUTH_SERVICE_NAME] = "HMAC";
    params[gadgets.io.RequestParameters.REFRESH_INTERVAL] = 3600;

    var url = "https://applicationid.appspot.com/user/" + sender_name;    
    gadgets.io.makeRequest(url, onResponse, params);
}

function onResponse(response) { 
    if (response.rc != 200) {
        document.getElementById('profile-container').innerHTML = 'Service temporarily unavailable.';
        gadgets.window.adjustHeight();
    } else {
        document.getElementById('profile-container').innerHTML = response.text;
        gadgets.window.adjustHeight();
  }
}

But here response.rc always returning status code as 500. And gadgets.io.makeRequest() function doesn't make any request to the url (application hosted on appengine). It seems like the issue with SIGNED Authorization. How to implement SIGNED Authorization in Gmail Gadget?

1
You could find how to implement Signed authorization on the reference: developers.google.com/gadgets/docs/referenceDayton Wang

1 Answers

0
votes

@NNJ - the OAUTH_SERVICE_NAME = HMAC option is not supported.

You'll need to use the RSA-SHA1 signature method, you can get the certificate from http://opensocialresources.appspot.com/static/igoogle.cert