You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@shindig.apache.org by Justin Wyllie <ju...@hotmail.co.uk> on 2010/06/02 20:16:57 UTC

Logging In: how does @viewer become known by their userId?

Thanks.

in JsonRpcServlet which seems to be the controller for RPC calls I've been picking over the request in doPost().

It is data structure which includes this fields:

userId: @viewer (actually its an array) 

My request is generated in my gadget with this line:

req.add(req.newFetchPersonRequest(opensocial.IdSpec.PersonId.VIEWER), "get_owner");

This is slightly simplified version.

Bascially if I intercept the request in JsonRpcServlet and replace @viewer with john.doe I get a result. At least my request for john.doe information works; I get his DisplayName etc back. (I still can't get his friends but that is another problem).

My question is: at what point is it intended that @viewer should be substituted by the actual viewer id:

i) Should this have happened in the gadget so the POST data would have include john.doe where now it includes userId: array ([0]=> '@viewer') ?

ii) Is it nothing to do with this and something to do with this param on the POST action url: st=john.doe:john.doe:3960:shindig:http://mms-oxford.com/gadgets/friends.xml:0:default which is what I see on the samplecontainer call?

iii) Is the current behaviour expected and it is up to me to replace @viewer with john.doe somewhere on the server side using our session?


Thanks for your answer.

Justin



> 
> Hi,
> 
> If you look at the samplecontainer you can change the viewer/owner to test
> your gadget with different owner/viewers.  The users are defined in
> canonicaldb.json
> 
> There's also a limited login functionality in java/server based off of
> Apache Shiro.  There's a lot more that we could do with that.
> 
> On Tue, Jun 1, 2010 at 9:07 AM, Justin Wyllie <ju...@hotmail.co.uk>wrote:
> 
> >
> > Hi
> >
> > I'm running Shindig.
> >
> > I'm trying to work through an example (using the sample data) where I get a
> > VIEWER's friends.
> >
> > I've found sample code for the gadget but it assumes that the VIEWER is
> > already logged in and their ID is known.
> >
> > I can't see how, using my own Shindig container, I can provide a login
> > mechanism. (All the examples talk about using the GFC or Orkut containers).
> >
> > Any pointers greatfully received.
> >
> > Thanks
> >
> > Justin
> >
> > _________________________________________________________________
> > http://clk.atdmt.com/UKM/go/197222280/direct/01/
> > Do you have a story that started on Hotmail? Tell us now
> >
 		 	   		  
_________________________________________________________________
http://clk.atdmt.com/UKM/go/197222280/direct/01/
We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now

Re: Logging In: how does @viewer become known by their userId?

Posted by Paul Lindner <li...@inuus.com>.
@viewer is substituted with the current viewer from the security token.  It's the expected behavior.

On Jun 2, 2010, at 11:16 AM, Justin Wyllie wrote:

> 
> Thanks.
> 
> in JsonRpcServlet which seems to be the controller for RPC calls I've been picking over the request in doPost().
> 
> It is data structure which includes this fields:
> 
> userId: @viewer (actually its an array) 
> 
> My request is generated in my gadget with this line:
> 
> req.add(req.newFetchPersonRequest(opensocial.IdSpec.PersonId.VIEWER), "get_owner");
> 
> This is slightly simplified version.
> 
> Bascially if I intercept the request in JsonRpcServlet and replace @viewer with john.doe I get a result. At least my request for john.doe information works; I get his DisplayName etc back. (I still can't get his friends but that is another problem).
> 
> My question is: at what point is it intended that @viewer should be substituted by the actual viewer id:
> 
> i) Should this have happened in the gadget so the POST data would have include john.doe where now it includes userId: array ([0]=> '@viewer') ?
> 
> ii) Is it nothing to do with this and something to do with this param on the POST action url: st=john.doe:john.doe:3960:shindig:http://mms-oxford.com/gadgets/friends.xml:0:default which is what I see on the samplecontainer call?
> 
> iii) Is the current behaviour expected and it is up to me to replace @viewer with john.doe somewhere on the server side using our session?
> 
> 
> Thanks for your answer.
> 
> Justin
> 
> 
> 
>> 
>> Hi,
>> 
>> If you look at the samplecontainer you can change the viewer/owner to test
>> your gadget with different owner/viewers.  The users are defined in
>> canonicaldb.json
>> 
>> There's also a limited login functionality in java/server based off of
>> Apache Shiro.  There's a lot more that we could do with that.
>> 
>> On Tue, Jun 1, 2010 at 9:07 AM, Justin Wyllie <ju...@hotmail.co.uk>wrote:
>> 
>>> 
>>> Hi
>>> 
>>> I'm running Shindig.
>>> 
>>> I'm trying to work through an example (using the sample data) where I get a
>>> VIEWER's friends.
>>> 
>>> I've found sample code for the gadget but it assumes that the VIEWER is
>>> already logged in and their ID is known.
>>> 
>>> I can't see how, using my own Shindig container, I can provide a login
>>> mechanism. (All the examples talk about using the GFC or Orkut containers).
>>> 
>>> Any pointers greatfully received.
>>> 
>>> Thanks
>>> 
>>> Justin
>>> 
>>> _________________________________________________________________
>>> http://clk.atdmt.com/UKM/go/197222280/direct/01/
>>> Do you have a story that started on Hotmail? Tell us now
>>> 
> 		 	   		  
> _________________________________________________________________
> http://clk.atdmt.com/UKM/go/197222280/direct/01/
> We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now