From d72429a0030504db7444da2ab54a59fb53a79484 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Fri, 19 Oct 2018 22:32:13 +0530 Subject: [PATCH] BAEL-9467 Update Spring Security article -Removed redundant field --- .../main/java/org/baeldung/spring/SecurityJavaConfig.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/spring-security-rest/src/main/java/org/baeldung/spring/SecurityJavaConfig.java b/spring-security-rest/src/main/java/org/baeldung/spring/SecurityJavaConfig.java index d5111f9b20..cc023110b6 100644 --- a/spring-security-rest/src/main/java/org/baeldung/spring/SecurityJavaConfig.java +++ b/spring-security-rest/src/main/java/org/baeldung/spring/SecurityJavaConfig.java @@ -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