Announcement Announcement Module
No announcement yet.
password encoder configuration problem Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • password encoder configuration problem

    I've been fighting a battle all morning with configuring the password encoder for the authentication manager. No matter what I try, I wind up with a spring Md5PasswordEncoder in my DaoAuthenticationProvider. Here's my current security configuration:

        <http auto-config="true" access-decision-manager-ref="accessDecisionManager">
            <intercept-url pattern="/" access="permitAll"/>
            <intercept-url pattern="/**" access="isAuthenticated()"/>
            <form-login />
            <logout logout-success-url="/" />
        <beans:bean id="accessDecisionManager" class="">
            <beans:property name="decisionVoters">
                    <beans:bean class=""/>
                    <beans:bean class="">
                        <beans:property name="rolePrefix" value=""/>
                    <beans:bean class=""/>
            <authentication-provider user-service-ref="userDetailsService">
                <password-encoder hash="sha"/>
    My userDetailsService bean is an autowired bean that implements the DetailsService interface. This configuration results in a DaoAuthenticationProvider that has an instance of my custom UserDetailsService class... but the password encoder is still an Md5PasswordEncoder.

    Anyone know what I'm doing wrong?

  • #2
    Would you mind trying to do the password encoding according to your requirement using below configuration:

    <authentication-manager alias="authenticationManager">
        	<authentication-provider user-service-ref="jdbcUserService">
        		<password-encoder ref="passwordEncoder">
        			<salt-source ref="saltSource"/>
    beans:bean class="" id="passwordEncoder">
    	<beans:constructor-arg value="256"/>
    <beans:bean class="" id="saltSource">
    	<beans:property name="userPropertyToUse" value="username"/>