So, I'm using gadgets.io.makeRequest(url, callback, params)
to make requests from Gmail contextual gadget and verifying these requests on the server side.
To clarify, I'm using the following makeRequest params on the gadget side:
params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.DOM;
params[gadgets.io.RequestParameters.AUTHORIZATION] = gadgets.io.AuthorizationType.SIGNED;
params["OAUTH_SERVICE_NAME"] = "HMAC";
params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET;
I've obtained gadget's consumerKey and consumerSecret from https://www.google.com/gadgets/directory/verify
According to Google's documentation, the request is signed by the container according to OAuth signing process HMAC-SHA1 method.
On the server side, I receive the following request:
Then I'm signing this request according to the same OAuth specification that Google is supposed to use, but the signatures don't match.
I've already tried signing the request using 2 different libs:
- Our home-grown .Net lib, which is used to sign requests for Gmail IMAP OAuth authorization (which uses the same signing method and it works just fine there).
- One of the contributed opensocial libs (http://code.google.com/p/opensocial-net-client/)
Both libs produce similar signature base strings. However, weirdly enough, they produce different signatures, and none of these signatures match the one sent by Google in oauth_signature param!
Fellow gadget developers, I hope someone of you was more lucky then me and made this signature verification method work. Please, tell me what I'm doing wrong here.
Thanks in advance,
buru