[Seaside] persisting across redirect..

Paul DeBruicker pdebruic at gmail.com
Mon Oct 1 15:27:07 UTC 2012


Can you store the oAuth code in an inst var in the user?





On 10/01/2012 07:45 AM, sergio_101 wrote:
> the way the facebook authorization scheme works is as follows:
>
> 1. on the first go round, facebook sends a POST with some data in it
>     that needs to be parsed to pull an authorization code out of it.
> 2. if the app isn't authorized, i need to redirect to an authorization
>     dialog to so that the user can authorize my app.
> 3. once the user does that, my app receives an oauth code, and i am on
>     my way.
>
> i have everything working, except, i am not sure where to store the
> authorization code..
>
> in my main component's renderOn, it looks to see if the a instance
> variable 'oauthToken' is set. if not, it renders some javascript that
> is really just a redirect to the facebook authorization screen.
>
> once the app is authorized, 'oauthToken' is set to the correct value.
>
> then, the authorization dialog sends the request BACK to the root
> url..
>
> everything works correctly..BUT.. on the second time back, the
> redirect from facebook, it looks like it starts a brand new session
> (there is a new instance of the main component created).
>
> i was hoping that this would all be one session, and that i could just
> set an instance variable once, and not even touch the session, but i
> don't think this is going to happen. plus, it looks like i will be
> firing up a new session on return anyway, so what i have saved in
> session will be lost.
>
> anyone have any ideas on how to cleanly persist this variable after
> facebook's redirect?
>



More information about the seaside mailing list