1
0
mirror of synced 2026-08-05 17:57:15 +00:00

DaoAuthenticationProvider uses DelegatingPasswordEncoder

This means that passwords will be encoded with BCrypt by default

Fixes: gh-2775
This commit is contained in:
Rob Winch
2017-10-23 13:35:42 -05:00
parent d19b222b55
commit 8291f20796
40 changed files with 197 additions and 150 deletions
@@ -20,6 +20,7 @@ import org.springframework.security.config.annotation.authentication.builders.Au
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.userdetails.User;
/**
* @author Joe Grandja
@@ -44,7 +45,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth
.inMemoryAuthentication()
.withUser("user").password("password").roles("USER");
.withUser(User.withDefaultPasswordEncoder().username("user").password("password").roles("USER"));
}
// @formatter:on
}