Salut Cyrille

This trick has two parts:
1) the acegi configuration:

        <bean id="authenticationProcessingFilter"
                  
class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter">
                <property name="authenticationManager" 
ref="authenticationManager"/>
                <property name="authenticationFailureUrl" 
value="/Login.page?login_error=1"/>
                <property name="defaultTargetUrl" value="/Home.page"/>
                <property name="filterProcessesUrl" 
value="/j_acegi_security_check"/>
        </bean>

The important property here is "authenticationFailureUrl", pay
attention to the added parameter "?login_error=1" after the login page
name.

2) Then in your login page you check if the "login_error" parameter exist.

        <div jwcid="@If" class="error"
condition="ognl:webRequest.getParameterValue('login_error')"
element="div">
                <img jwcid="@Any" src="images/bullet_error.png"
alt="message:icon.warning" class="icon"/>
                <span jwcid="@Insert" 
value="message:org.trails.login.error">Error:
Wrong Username or Password</span>
        </div>


I hope this helps.
Alejandro.


On 7/3/07, #Cyrille37# <[EMAIL PROTECTED]> wrote:
Ken nashua a écrit :
> Here is a sample working login...
>
> Best I can provide at this point.
>
> public abstract class LoginPage extends BasePage {
>
>     private static final Log LOG = LogFactory.getLog(LoginPage.class);
>
>     public abstract String getUsername();
>
>     public abstract String getPassword();
>
>     public void login(IRequestCycle cycle) throws RedirectException {
>
>         LOG.debug("User " + getUsername() + " is attempting login.");
>
>         String acegiUrl =
> cycle.getAbsoluteURL("/j_acegi_security_check?j_username=" +
> getUsername() + "&j_password=" + getPassword());
>
>         throw new RedirectException(acegiUrl);
>     }
> }
>
Thanks but it is not what I need. And in my post there was exactly the
same code (for login method).

What I would like to find is how to distinguish between an arrival on
the Login page for login against an arrival because login failed while
I'm using the same page for Acegi parameters
AuthenticationProcessingFilterEntryPoint.loginFormUrl (Login) and
AuthenticationProcessingFilter.authenticationFailureUrl (LoginFailed)

cheers
cyrille


---------------------------------------------------------------------
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