It would be nice if it were easier to get the full URL for a page like discussed here http://issues.apache.org/jira/browse/WICKET-609

Whoops - I see this is already fixed in the 1.3 release. The javadocs just haven't been updated yet:
http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/protocol/http/RequestUtils.html

Alex

On Jan 4, 2008, at 10:54 AM, Alex Jacoby wrote:

Thanks for the advice. What you suggested is exactly what I've been working on. I think I got it for now, but it's not pretty. Wicket- auth-roles takes care of figuring out that the user isn't authorized for a particular page "behind the scenes", so by the time my code knows that the user is being redirected to the login page, the original request is lost. My workaround is to save the original request URL in the session in the AuthenticatedWebSession#getRoles method on every request, even when it's not needed. That method always seems to get called.

It would be nice if it were easier to get the full URL for a page like discussed here http://issues.apache.org/jira/browse/WICKET-609

Thanks for the help,
Alex


On Jan 4, 2008, at 3:52 AM, Jeremy Thomerson wrote:

It's really late here and I'm not at a computer, so this is somewhat pseudo-code, but try this:

// place where you caught that they weren't
// authenticated (before page construction)
String url = getRequest ().getServletResponse().getUrlOrSomethingICantRememberRightNow(); throw new RestartResponseAtInterceptPageException(new RedirectPage("/perl-stuff/signin.pl?dest=" + url));

Of course, you could encrypt the destination or something if it was critical, but typically that shouldn't be a problem.

Hope this helps.

Jeremy Thomerson
-- sent from a wireless device

-----Original Message-----
From: "Erik van Oosten" <[EMAIL PROTECTED]>
To: users@wicket.apache.org
Sent: 1/4/08 2:23 AM
Subject: Re: external login pages

Hi Alex,

Normally you can throw a special exception, the
RestartResponseAtInterceptPageException. Unfortunately I do not think
this will work when the intercept page is external to Wicket.

So the only thing you can do, is put the original URL in a parameter to the perl page, and let the perl page use that as second redirect. Makes
sense?

Regards,
  Erik.



Alex Jacoby wrote:
I am building a new wicket app that has to use an existing login
page.  The legacy login page is written in perl and sets a login
cookie before redirecting the user back to a specified URL.

I'm hoping to keep things simple and use role-based authorization for
pages.  In my authenticated app the login page is set to a
RedirectPage which redirects to the external login page.  My problem
is that I can't figure out how to grab the original URL that sent me
to the login page, so that I can pass that URL to the external login
page, and thereby be sent to my original destination after login.
(Currently I just send them back to the home page, which is annoying.)

Has anyone tried this before? I've got a feeling there's a better way I could be doing this -- my current version using AuthenticatedWebApp
is very kludgy.

Thanks for any ideas,
Alex

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to