Nov 2nd, 2011, 06:08 PM
loadUserByUsername method is never called
This is my configuration
<http use-expressions="true" auto-config="false">
<intercept-url pattern="/login" access="permitAll" />
<intercept-url pattern="/resources/**" filters="none" />
<intercept-url pattern="/**" access="isAuthenticated()" />
<form-login always-use-default-target="true" login-page="/login"
<logout invalidate-session="true" />
<authentication-provider user-service-ref="userService" />
<beans:bean id="userService" class="com.example.service.UserServiceImpl"></beans:bean>
But method loadUserByUsername is never called. Can somebody help me? I use spring security 3.0.5.RELEASE version.
Nov 3rd, 2011, 08:16 AM
What are you doing to try to get it to be called? How are you validating it is not called? Have you tried turning on logging for Spring Security? What do the logs look like?
PS: when posting configuration, logs, code, etc please use code tags (i.e. the # button) to make it easier for others to read
Nov 3rd, 2011, 08:28 AM
Well I'm trying to configure basic scenario to login. I have standard spring login page. I submit login information to j_spring_security_check. No errors in console, and I've always been redirected to login error page. It just won't authenticate the user, or even try (I check it in debug mode). I use implementation of UserDetailService as an authentication provider and it's loadUserByUsername method never get called. I haven't tried to turn logging for spring security, I will do that.
Nov 3rd, 2011, 02:03 PM
Make sure you are using a POST to submit your credentials. If that isn't it provide your logs and login page.
Nov 4th, 2011, 04:42 AM
I turned on spring security debug logging and I got answer. I was sending GET request and only POST is supported. It it works perfectly now.
You where right. Thank you.