Merge pull request #3916 from steinhauer-software/BAEL-1489
BAEL-1489: Password storage in Spring Security 5
This commit is contained in:
commit
30eeb09828
@ -12,7 +12,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>2.0.0.RC2</version>
|
<version>2.0.0.RELEASE</version>
|
||||||
<relativePath/> <!-- lookup parent from repository -->
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@ import java.util.Map;
|
|||||||
@Configuration
|
@Configuration
|
||||||
public class PasswordStorageWebSecurityConfigurer extends WebSecurityConfigurerAdapter {
|
public class PasswordStorageWebSecurityConfigurer extends WebSecurityConfigurerAdapter {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||||
auth.eraseCredentials(false) // 4
|
auth.eraseCredentials(false) // 4
|
||||||
@ -31,8 +30,11 @@ public class PasswordStorageWebSecurityConfigurer extends WebSecurityConfigurerA
|
|||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public UserDetailsService getUserDefaultDetailsService() {
|
public UserDetailsService getUserDefaultDetailsService() {
|
||||||
User testUser = new User("baeldung", "{noop}SpringSecurity5", Collections.emptyList());
|
return new InMemoryUserDetailsManager(User
|
||||||
return new InMemoryUserDetailsManager(testUser);
|
.withUsername("baeldung")
|
||||||
|
.password("{noop}SpringSecurity5")
|
||||||
|
.authorities(Collections.emptyList())
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
Loading…
x
Reference in New Issue
Block a user