You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Anh <7z...@gmail.com> on 2010/07/28 06:02:31 UTC

Transparent FB auth from cookie?

Hi,

Having trouble with how this would best be done in Wicket:

I have a Facebook OAuth token, which I use to request data from FB API
and then assemble a User object.

What I'd like to do is store this token in a Cookie, and whenever the
user requests any page in my Wicket app, I'd like to reassemble the
User object and put it in the WicketSession first.

This works fine if I send a user to a "login page" that looks up the
token, etc, but I'd rather this be transparent so that any page could
be requested, without smearing this logic into every page.


Is there a clean way to do this?


Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Transparent FB auth from cookie?

Posted by Anh <7z...@gmail.com>.
Yes, though this didn't see "right" to me.
I can certainly try this though.

Thanks


On Wed, Jul 28, 2010 at 7:02 AM, Don Ferguson <do...@gmail.com> wrote:
> Do you have a base page that the others inherit from?  That would be the
> place to do it...
>
> On Jul 27, 2010, at 9:02 PM, Anh wrote:
>
>> Hi,
>>
>> Having trouble with how this would best be done in Wicket:
>>
>> I have a Facebook OAuth token, which I use to request data from FB API
>> and then assemble a User object.
>>
>> What I'd like to do is store this token in a Cookie, and whenever the
>> user requests any page in my Wicket app, I'd like to reassemble the
>> User object and put it in the WicketSession first.
>>
>> This works fine if I send a user to a "login page" that looks up the
>> token, etc, but I'd rather this be transparent so that any page could
>> be requested, without smearing this logic into every page.
>>
>>
>> Is there a clean way to do this?
>>
>>
>> Thanks!
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Transparent FB auth from cookie?

Posted by Don Ferguson <do...@gmail.com>.
Do you have a base page that the others inherit from?  That would be  
the place to do it...

On Jul 27, 2010, at 9:02 PM, Anh wrote:

> Hi,
>
> Having trouble with how this would best be done in Wicket:
>
> I have a Facebook OAuth token, which I use to request data from FB API
> and then assemble a User object.
>
> What I'd like to do is store this token in a Cookie, and whenever the
> user requests any page in my Wicket app, I'd like to reassemble the
> User object and put it in the WicketSession first.
>
> This works fine if I send a user to a "login page" that looks up the
> token, etc, but I'd rather this be transparent so that any page could
> be requested, without smearing this logic into every page.
>
>
> Is there a clean way to do this?
>
>
> Thanks!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Transparent FB auth from cookie?

Posted by Anh <7z...@gmail.com>.
Works lovely, thanks Igor

On Wed, Jul 28, 2010 at 8:25 AM, Igor Vaynberg <ig...@gmail.com> wrote:
> RequestCycle#onBeginRequest()
>
> -igor
>
> On Tue, Jul 27, 2010 at 9:02 PM, Anh <7z...@gmail.com> wrote:
>> Hi,
>>
>> Having trouble with how this would best be done in Wicket:
>>
>> I have a Facebook OAuth token, which I use to request data from FB API
>> and then assemble a User object.
>>
>> What I'd like to do is store this token in a Cookie, and whenever the
>> user requests any page in my Wicket app, I'd like to reassemble the
>> User object and put it in the WicketSession first.
>>
>> This works fine if I send a user to a "login page" that looks up the
>> token, etc, but I'd rather this be transparent so that any page could
>> be requested, without smearing this logic into every page.
>>
>>
>> Is there a clean way to do this?
>>
>>
>> Thanks!
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Transparent FB auth from cookie?

Posted by Igor Vaynberg <ig...@gmail.com>.
RequestCycle#onBeginRequest()

-igor

On Tue, Jul 27, 2010 at 9:02 PM, Anh <7z...@gmail.com> wrote:
> Hi,
>
> Having trouble with how this would best be done in Wicket:
>
> I have a Facebook OAuth token, which I use to request data from FB API
> and then assemble a User object.
>
> What I'd like to do is store this token in a Cookie, and whenever the
> user requests any page in my Wicket app, I'd like to reassemble the
> User object and put it in the WicketSession first.
>
> This works fine if I send a user to a "login page" that looks up the
> token, etc, but I'd rather this be transparent so that any page could
> be requested, without smearing this logic into every page.
>
>
> Is there a clean way to do this?
>
>
> Thanks!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org