Thanks Jason, PeopleTest does in fact work with the ORKUT_ID you
provided.
The 401 I was seeing I believe was from trying to use the google email
address instead of the Orkut OpenSocial numeric ID which I didn't
realize existed. I found a gadget that shows you the numeric
OpenSocial ID for Orkut, so I am able to obtain that ID number. Then,
I was able to get data from the PeopleService successfully using my
own key, secret, and open social ID.
However, now I would like to post an Activity from my server to
Orkut. Is this possible with 2-legged Auth, or does it require the 3-
legged mechanism? I noticed the included tests don't post an Activity
via Orkut (MySpace only). When I tried this:
Activity activity = new Activity();
activity.setTitle("I am an activity title.");
activity.setTitleId("test");
activity.setBody("I am an activity body.");
Request request2 = ActivitiesService.createActivity(activity);
Response response2 = client.send(request2);
Object o = response2.getEntry();
System.out.println(o.toString());
I got the following "Permission token validation failed", with a 403
return code. Logs are as follows:
http://sandbox.orkut.com/social/rpc?xoauth_requestor_id=17329722700454841612&oauth_body_hash=tIuCnRi88gSGPU41YwmZu4FwiwI%3D&oauth_consumer_key=orkut.com%3A382502921366&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1277052024&oauth_nonce=9385311928574&oauth_version=1.0&oauth_signature=GPY1PNYL4ZC1J3zjHwpHe47GkmI%3D
[{"id":"key","method":"activities.create","params":
{"groupId":"@self","appId":"@app","userId":"@me","activity":{"body":"I
am an activity body.","title":"I am an activity title."}}}]
200
[{"id":"key","error":{"message":"forbidden: Permission token
validation failed.","data":{"errorType":"noPermissions"},"code":403}}]
I did set all the available permissions on the gadget in my sandbox
account. I'm also a little unclear about how OpenSocial types
(Activity) for example maps to Orkut types ("Says" vs. "Scrap" etc).
On Jun 19, 8:32 pm, "Jason (Google)" <
apija...@google.com> wrote:
> I was seeing the same thing when running
> test/org/opensocial/online/PeopleTest.java using the ID provided, but when I
> swapped out the ID with another that did have the gadget installed,
> everything worked. In that case, the issue was caused by a 403 response from
> the server because the gadget was no longer installed on the profile, and
> only using 2-legged OAuth -- 3-legged OAuth continued to work. It sounds
> like you're seeing a different cause.
>
> Please help me by doing a few things:
>
> - Enable log output for your app by following the instructions at
>
http://code.google.com/p/opensocial-java-client/wiki/Debugging. If you
> execute a simple RPC request with log output enabled, you should clearly see
> the reason that the request is failing in the response, something like:
>
> [{"id":"key","error":{"message":"forbidden: Get profile permission
> denied.","data":{"errorType":"noPermissions"},"code":403}}]
>
> - Try running PeopleTest with ORKUT_ID set to "01495306580392390900" and
> >
opensocial-client-l...@googlegroups.com<opensocial-client-
libraries%2Bunsu...@googlegroups.com>
> > .