You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Cristi Manole <cr...@gmail.com> on 2007/10/19 17:08:29 UTC

Double "intercept"

Hello,

I was wondering if the following use case can be implemented in wicket:

-> a page requires authentification (@AuthorizeInstantiation())
-> if it's not authentif, it will be intercepted by a SignIn.class
-> based on a rule, i want to send the user to another page.
-> that page will redirect the user to the original page.

How could I accomplish this?

Thanks in advance.

Re: Double "intercept"

Posted by Cristi Manole <cr...@gmail.com>.
I think you didn't understand, but tks a lot for your idea.

What i need is:

1. i have a page which is annotated to be created only if authenticated.
2. if the user is not autheticated and wants to go to that page, he will be 
redirected to sign in page.
3. on the sign in page, after the user logges in, i want the user to be 
redirected to another page, where by pressing a button he will end up in the 
original page (now being authenticated).

My problem is if i put setResponsePage(WhatEverPage.class) in SignIn class, 
when i'm on WhatEver class, i cannot say continueToOriginalDestination cause 
the original page will no longer be on PageMap (i think) -> it will return 
false always.

So , again, how can i do this? :-?

Tks in advance.
----- Original Message ----- 
From: "Maurice Marrink" <ma...@gmail.com>
To: <us...@wicket.apache.org>
Sent: Friday, October 19, 2007 9:48 PM
Subject: Re: Double "intercept"


> Not sure why you would want the double redirect ..... but here goes.
> Use either Swarm, Auth-roles or a custom security implementation to
> redirect you to a login page. After sign-in use setResponsePage to
> redirect the user to your other page. In that page you can then return
> the user to the original page by calling
> continueToOriginalDestination() followed by a return in the
> constructor. However keep in mind that there is not always an original
> destination (see return value of continueToOriginalDestination()).
>
> The above is just as easily accomplished with just one intercept. By
> using this little construct in your sign-in page after signing in.
>
> if (!getPage().continueToOriginalDestination())
> {
> setResponsePage(WhatEverPage.class); //or new WhatEverPage(complex
> constructor);
> }
>
> Maurice
>
> On 10/19/07, Cristi Manole <cr...@gmail.com> wrote:
>> Hello,
>>
>> I was wondering if the following use case can be implemented in wicket:
>>
>> -> a page requires authentification (@AuthorizeInstantiation())
>> -> if it's not authentif, it will be intercepted by a SignIn.class
>> -> based on a rule, i want to send the user to another page.
>> -> that page will redirect the user to the original page.
>>
>> How could I accomplish this?
>>
>> Thanks in advance.
>>
>
> ---------------------------------------------------------------------
> 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: Double "intercept"

Posted by Maurice Marrink <ma...@gmail.com>.
Not sure why you would want the double redirect ..... but here goes.
Use either Swarm, Auth-roles or a custom security implementation to
redirect you to a login page. After sign-in use setResponsePage to
redirect the user to your other page. In that page you can then return
the user to the original page by calling
continueToOriginalDestination() followed by a return in the
constructor. However keep in mind that there is not always an original
destination (see return value of continueToOriginalDestination()).

The above is just as easily accomplished with just one intercept. By
using this little construct in your sign-in page after signing in.

if (!getPage().continueToOriginalDestination())
{
	setResponsePage(WhatEverPage.class); //or new WhatEverPage(complex
constructor);
}

Maurice

On 10/19/07, Cristi Manole <cr...@gmail.com> wrote:
> Hello,
>
> I was wondering if the following use case can be implemented in wicket:
>
> -> a page requires authentification (@AuthorizeInstantiation())
> -> if it's not authentif, it will be intercepted by a SignIn.class
> -> based on a rule, i want to send the user to another page.
> -> that page will redirect the user to the original page.
>
> How could I accomplish this?
>
> Thanks in advance.
>

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