Hi Michael,

2009/5/26 Michael Gerzabek <michael.gerza...@gmx.net>

> Borut Bolčina schrieb:
>
>> I need to configure AuthenticationProcessingFilter "on the fly".
>>
> Are you sure? Or do you just want different failureURLs?


I just want a different failureURL.


>
>  Can I
>> inject the filter and call the setAuthenticationFailureUrl(failureUrl) in
>> my
>> page class? I want to have different failureUrl based on some condition.
>>
>>
> Aha. Mhm. I think the easiest would be to inject the
> AuthenticationProcessingFilter into your service or whereever you decide
> which failureURL to serve and call setAuthenticationFailureUrl() with the
> correct URL. Don't know where in the request chain you might do this though.


I have two login pages (src/main/java/com/foo/bar/Login and
src/main/java/com/foo/bar/acme/Login which extends the first one). The only
difference is a different layout component (for now), so in other words - it
looks quite different.

What I intended to do was to setAuthenticationFailureUrl(acme/login) in the
acme/Login class so if the user fails to present the correct username and
password, he/she won't be presented the wrong Login page (which is failure
url set in the contributeApplicationDefaults method). So if user fails to
login in the first Login page, he/she is presented with Login/failed and if
he/she fails on the acme/Login page he/she is presented with
acme/Login/failed failureUrl.

Cheers,
Borut


>
> BUT: I cannot imagine a case where your software would act like that. Since
> when authentication fails you probably might inform your user why this
> happens. So a discrete page with the logic to display the results of your
> role voters or similar security aspects may seem old fashioned but did the
> job for me in the past.
>
> Third possibility might be to write your own
> AuthenticationProcessingFilter, you could extend it, prepare it with your
> logic and ...
>
>> Cheers,
>> Borut
>>
>> P.S. How far is tapestry-spring-security from being T5.1 compatible?
>>
>>
>>
> This is finally in the pipeline now.
>
> Cheers,
> Michael
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

Reply via email to