BAEL-9467 Update Spring Security article
-Removed redundant field
This commit is contained in:
parent
88600298a2
commit
d72429a003
|
@ -23,9 +23,6 @@ import org.springframework.security.web.authentication.SimpleUrlAuthenticationFa
|
||||||
@ComponentScan("org.baeldung.security")
|
@ComponentScan("org.baeldung.security")
|
||||||
public class SecurityJavaConfig extends WebSecurityConfigurerAdapter {
|
public class SecurityJavaConfig extends WebSecurityConfigurerAdapter {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PasswordEncoder encoder;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CustomAccessDeniedHandler accessDeniedHandler;
|
private CustomAccessDeniedHandler accessDeniedHandler;
|
||||||
|
|
||||||
|
@ -45,9 +42,9 @@ public class SecurityJavaConfig extends WebSecurityConfigurerAdapter {
|
||||||
@Override
|
@Override
|
||||||
protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
|
protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
|
||||||
auth.inMemoryAuthentication()
|
auth.inMemoryAuthentication()
|
||||||
.withUser("admin").password(encoder.encode("adminPass")).roles("ADMIN")
|
.withUser("admin").password(encoder().encode("adminPass")).roles("ADMIN")
|
||||||
.and()
|
.and()
|
||||||
.withUser("user").password(encoder.encode("userPass")).roles("USER");
|
.withUser("user").password(encoder().encode("userPass")).roles("USER");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue