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")
|
||||
public class SecurityJavaConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
@Autowired
|
||||
private PasswordEncoder encoder;
|
||||
|
||||
@Autowired
|
||||
private CustomAccessDeniedHandler accessDeniedHandler;
|
||||
|
||||
|
@ -45,9 +42,9 @@ public class SecurityJavaConfig extends WebSecurityConfigurerAdapter {
|
|||
@Override
|
||||
protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
|
||||
auth.inMemoryAuthentication()
|
||||
.withUser("admin").password(encoder.encode("adminPass")).roles("ADMIN")
|
||||
.withUser("admin").password(encoder().encode("adminPass")).roles("ADMIN")
|
||||
.and()
|
||||
.withUser("user").password(encoder.encode("userPass")).roles("USER");
|
||||
.withUser("user").password(encoder().encode("userPass")).roles("USER");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue