BAEL-9467 Update Spring Security article

-Removed redundant field
This commit is contained in:
Dhawal Kapil 2018-10-19 22:32:13 +05:30
parent 88600298a2
commit d72429a003
1 changed files with 2 additions and 5 deletions

View File

@ -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