Hello,

I've been trying to integrate T5 and Spring Security (2.0.4, not the older
Acegi) but haven't succeeded in making the two work together.

The standard way to specify a form login with Spring 2.5 is like below. See
the <form-login> element which specified the login page (Login) and what URL
Spring will intercept (the standard j_security_check).

<b:beans xmlns="http://www.springframework.org/schema/security";
    <http>
        <form-login login-page="/Login"
                    default-target-url="/Start"
                    authentication-failure-url="/Login?login_error=1"
                    login-processing-url="j_security_check" />
    </http>

I have a typical Login.tml (labels and cosmetic stuff removed for brevity)

<t:form t:id="loginForm">
    <table><tr><td><input type="text" t:id="j_username" t:type="TextField"
t:value="j_username"/></td></tr>
        <tr><td><input type="text" t:id="j_password" t:type="PasswordField"
t:value="j_password"/></td></tr>
        <tr><input type="submit" value="Log In"/></td> </tr>
    </table>
</t:form>

What happens is that the POST that occurs when submitting the form goes to
the Login.onSubmit() instead of j_security_check. While it is possible to
add code there to call Spring's AuthenticationManager, I would end up
duplicating what Spring Security does (the logic to redirect to different
pages if the login succeeded or not and so on). I'd like to use Spring since
it already implements this.

Is it possible to submit the login info to j_security_check instead? Or to
forward the request from within Login.onSubmit() to /j_security_check?

I went through the "Tapestry 5" book by Alexander Kolesnikov, but didn't
find this info. Also, I am aware of the tapestry5-acegi extension (
http://www.localhost.nu/java/tapestry5-acegi/) but this one seems under
development and for such a simple thing I didn't want to add a dependency on
another jar.

As you can tell, I'm new to T5. I've had some exposure to T4 and an older
version of Spring (2.0) but there things were quite different, both in
Tapestry itself and in how Acegi is configured  in Spring.

Advice is appreciated,
JL

Reply via email to