I am using a customized UserDetailsService for my Spring security settings.
The customized UserDetailsService has only one method which overrides loadUserByUsername(final String username) in UserDetailsService.
I’ve below configuration in applicationConext-security.xml:
<authentication-manager alias="myAuthenticationManager">
<authentication-provider user-service-ref="userDetailsService"/>
</authentication-manager>
<beans:bean id="userDetailsService"
class="temp.com.JpaUserDetailsService" />
However when I tried to login using a username I get the error saying the arguement “username” is null. I wonder where does username come from and how can I avoid it to be null?
There are several possibilities for this, and since you haven’t posted any stack trace, it’s unclear if the problem is in your code, or configuration:
If you can post your full configuration (specifically noting whatever you have customized), I/we can offer more precise advice, but I would suggest that one of these things is most likely to be your problem.