Re: keep username on failed logins with tapestry-spring-security
Aah yes, Excellent, so it seems at least three people have picked up this library... oh well. The way of retrieving the user name is indeed a good one, i use it also but to retrieve the error code from spring, eg: AuthenticationException authErr = (AuthenticationException)httpServletRequest.getSession().getAttribute(AbstractProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY); Regards, Antal -- View this message in context: http://tapestry.1045711.n5.nabble.com/keep-username-on-failed-logins-with-tapestry-spring-security-tp5451046p5453806.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: keep username on failed logins with tapestry-spring-security
The Maven plugin in Eclipse helped me :) The original tss module seems to be quite inactive, but several guys continued to work on github (lobbin, llyk, anttalk). I saw your work anttalk, thanks for continuing the work. However, I used the one that my maven offered me: https://github.com/lltyk/tapestry-spring-security When using the default T5-Starter Setup, the following repository is used: https://repository.apache.org/content/groups/staging/ There you'll find it under com.github.lltyk tapestry-spring-security 3.0.3 compile Cheers Beat 2012/2/3 antalk > Yes, > > I'm interrested to because it could not find a version of this module being > compatible with Tapestry 5.3.x. > > Therefor i've build my own version which can be found at : > > https://github.com/antalk/Tapestry-Spring-Security > > This is version 4.0.0 and fully works with Tapestry 5.3.x > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/keep-username-on-failed-logins-with-tapestry-spring-security-tp5451046p5453137.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: keep username on failed logins with tapestry-spring-security
Yes, I'm interrested to because it could not find a version of this module being compatible with Tapestry 5.3.x. Therefor i've build my own version which can be found at : https://github.com/antalk/Tapestry-Spring-Security This is version 4.0.0 and fully works with Tapestry 5.3.x -- View this message in context: http://tapestry.1045711.n5.nabble.com/keep-username-on-failed-logins-with-tapestry-spring-security-tp5451046p5453137.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: keep username on failed logins with tapestry-spring-security
Hi Which version of tapestry-security are you using with T5.3 ? Where can I find it ? Tom Le 02/02/2012 18:59, Beat Durrer a écrit : > Hi guys > > I was able to solve the issue myself, yay! > For those interested, here is the simple solution: > > By reading the source code of t-s-s I discovered that the > UsernamePasswordAuthenticationFilter saves the username into the session. > > void onActivate(String extra) { > if (extra.equals("failed")) { > failed = true; > } > > Session session = request.getSession(false); > if( session != null) { > Object usrnameObj = > session.getAttribute(UsernamePasswordAuthenticationFilter.SPRING_SECURITY_LAST_USERNAME_KEY); > username = (usrnameObj != null) ? usrnameObj.toString() : null; > } > } > > > Cheers > Beat > > > > 2012/2/2 Beat Durrer > >> Hi there, >> >> I added tapestry-spring-security 3.0.3 to the T5.3 archetype, following >> the sample app under >> http://www.localhost.nu/java/tapestry-spring-security/conf.html >> Everything works fine. >> >> How can I retrieve the username when a user fails to log in (to put it >> into the input field again)? >> The tapestry-spring-security handler does not bother to include the >> username when redirecting to a login failed URL (which I defined to be the >> Login page). >> >> Can I somehow elegantly intercept a form before forwarding all data to the >> j_spring_security_check? >> I considered a tapestry form and a onSuccess handler, but then I would >> need to forge a request including all the form fields (which just isn't >> really cool). >> >> Any suggestions, please? :) >> >> Thanks in advance! >> Beat >> - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: keep username on failed logins with tapestry-spring-security
Hi guys I was able to solve the issue myself, yay! For those interested, here is the simple solution: By reading the source code of t-s-s I discovered that the UsernamePasswordAuthenticationFilter saves the username into the session. void onActivate(String extra) { if (extra.equals("failed")) { failed = true; } Session session = request.getSession(false); if( session != null) { Object usrnameObj = session.getAttribute(UsernamePasswordAuthenticationFilter.SPRING_SECURITY_LAST_USERNAME_KEY); username = (usrnameObj != null) ? usrnameObj.toString() : null; } } Cheers Beat 2012/2/2 Beat Durrer > Hi there, > > I added tapestry-spring-security 3.0.3 to the T5.3 archetype, following > the sample app under > http://www.localhost.nu/java/tapestry-spring-security/conf.html > Everything works fine. > > How can I retrieve the username when a user fails to log in (to put it > into the input field again)? > The tapestry-spring-security handler does not bother to include the > username when redirecting to a login failed URL (which I defined to be the > Login page). > > Can I somehow elegantly intercept a form before forwarding all data to the > j_spring_security_check? > I considered a tapestry form and a onSuccess handler, but then I would > need to forge a request including all the form fields (which just isn't > really cool). > > Any suggestions, please? :) > > Thanks in advance! > Beat >
keep username on failed logins with tapestry-spring-security
Hi there, I added tapestry-spring-security 3.0.3 to the T5.3 archetype, following the sample app under http://www.localhost.nu/java/tapestry-spring-security/conf.html Everything works fine. How can I retrieve the username when a user fails to log in (to put it into the input field again)? The tapestry-spring-security handler does not bother to include the username when redirecting to a login failed URL (which I defined to be the Login page). Can I somehow elegantly intercept a form before forwarding all data to the j_spring_security_check? I considered a tapestry form and a onSuccess handler, but then I would need to forge a request including all the form fields (which just isn't really cool). Any suggestions, please? :) Thanks in advance! Beat