Hello Marc,

It is indeed very easy once you know where to look :)
Once the user is authenticated in the Login page you do something like this:

if (!continueToOriginalDestination()) {
   setResponsePage(Application.get().getHomePage());
}

This will set the response page only when you got here directly. 
Otherwise it will use the original URL that was requested while the 
RestartResponseAtInterceptPageException was thrown in your code below.

Does this solve your problem, or did I misread something?

     Erik.


Marc-Andre Houle schreef:
> Hello group, it is again me for another question! :)
>
> I'm trying to build an Authorization strategy around 
> AbstractPageAuthorizationStrategy. 
> For now, the authorization strategy is really simple as you will see 
> in this copy-paste of code :
>     protected boolean isPageAuthorized(Class pageClass)
>     {
>         if(instanceOf(pageClass, BaseSecurePage.class) &&
>                 ((PortalSession)Session.get()).getSessionId () == null)
>         {
>             throw new 
> RestartResponseAtInterceptPageException(Login.class);
>         }
>         if(instanceOf (pageClass, BaseAdminPage.class))
>         {
>             return ((PortalSession)Session.get()).isUserAdmin ();
>         }
>         return true;
>     }
>
> For now, there was no problem at all and everything is perfect. But 
> the problem is, my boss want our application to support node linking 
> when not logged in.  you know, like you click on the link, the 
> application tell you to log in and after your log in you are 
> redirected to the correct page. 
> Seem's prety simple, load the class to get a page, add to this page 
> the parameters used before the trigger of the authorization strategy. 
> The problem is : I can't find a way to discover the page parameters.
>
> It is not accessible from the session nor the application (At least, 
> from what my search in the api have done).  So for now, I'm stuck with 
> a login page that do not know where to redirect after the login.
>
> Can somebody help me with that?
>
> Thanks in advance for the answer and really sorry if it is "so" obvious.
>
> Marc
>

-- 
Erik van Oosten
http://day-to-day-stuff.blogspot.com/


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to