I am trying to implement sha password encoding in my application, but it does not seem to work for some reason. Passwords are encoded in the database, but I cannot log in: Your login attempt was not successful, try again. Reason: Bad credentials .
Here is what I have so far:
applicatioContext-security.xml
Code:
<beans:bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.ShaPasswordEncoder">
	     <beans:constructor-arg value="256"/>
	</beans:bean>
and under <authentication-provider>
Code:
	<password-encoder hash="sha-256"/>
applicationContext.xml
Code:
<bean id="PasswordEncoder" class="com.dissertation.webtools.domain.PasswordEncoder">
	
	</bean>
And under User.java

Code:
    public void setPassword(String password) {
    	PasswordEncoder enc = new PasswordEncoder();
    	
    	System.out.println(password);
        this.password = enc.setEncrypt(password);
    }
Do you know why I cannot log in?