Now I am able to do it using SIGNED (not OAUTH) mimicking more or less
http://wiki.opensocial.org/index.php?title=Building_an_OpenSocial_App_with_Google_App_Engine
Though my work is done, however, I still did not succeed with OAUTH.
This is the sample code using OAUTH which does not work:
JavaScript:
----------------
function opensocial_test(post_data)
{
function handler(obj) {
...
}
var params = {}
params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.JSON;
params[gadgets.io.RequestParameters.METHOD] =
gadgets.io.MethodType.POST;
params[gadgets.io.RequestParameters.POST_DATA] = gadgets.io.encodeValues(post_data);
params[gadgets.io.RequestParameters.AUTHORIZATION] = gadgets.io.AuthorizationType.OAUTH;
gadgets.io.makeRequest('
http://www.xxx.com/opensocial_test', handler, params);
}
Server Side Python (TurboGears 2.0, actually)
------------------------------------------------------------------
def valid_sign_orkut():
params = {}
for key, value in tg.request.params.mixed().items():
params[key] = value.encode('utf-8', 'ignore')
oauth_request = oauth.OAuthRequest.from_request(tg.request.method,
tg.request.url,
params)
consumer = oauth.OAuthConsumer('
orkut.com:999999999999', 'xxxxxxxxxxxxxxxxxx')
# Actual key and secret are not given here