Witam,
teraz mam problem typu: przy rejestracji haszuje sobie do bazy hasła Encoderem 256. Jest on zarówno wstrzyknięty do kontekstu, jak i podany w authentication-providerze springowi, a mimo to mam wrażenie, że Security podczas logowania nie haszuje hasła, zanim porówna je z tym z bazy, które jest zahaszowane. Poniżej zamieszczam kod. Ma ktoś jakiś pomysł?
Authentication provider
<security:authentication-manager erase-credentials="true" >
<security:authentication-provider user-service-ref="userService">
<security:password-encoder hash="sha-256" ref="passwordEncoder" />
</security:authentication-provider>
</security:authentication-manager>
Tworzenie konta, miejsce haszowania hasla
account.setPassword(encoder.encodePassword(getPassword(), null));
Security config
@Bean(name = "passwordEncoder")
public ShaPasswordEncoder passwordEncoder() {
return new ShaPasswordEncoder(256);
}