From d4a9a95f43e0b911b76d03150603d191d463550c Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 21 Aug 2018 11:53:36 +0300 Subject: cleanup configuration --- .../main/java/com/juick/server/configuration/ApiSecurityConfig.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'juick-server/src/main/java/com/juick/server/configuration') diff --git a/juick-server/src/main/java/com/juick/server/configuration/ApiSecurityConfig.java b/juick-server/src/main/java/com/juick/server/configuration/ApiSecurityConfig.java index 41689bb1..8b37ef17 100644 --- a/juick-server/src/main/java/com/juick/server/configuration/ApiSecurityConfig.java +++ b/juick-server/src/main/java/com/juick/server/configuration/ApiSecurityConfig.java @@ -25,12 +25,14 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; +import org.springframework.security.authentication.AuthenticationProvider; import org.springframework.security.authentication.dao.DaoAuthenticationProvider; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.WebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.web.AuthenticationEntryPoint; import org.springframework.security.web.authentication.HttpStatusEntryPoint; import org.springframework.security.web.authentication.RememberMeServices; @@ -81,7 +83,7 @@ public class ApiSecurityConfig extends WebSecurityConfigurerAdapter { } @Bean - public DaoAuthenticationProvider authenticationProvider() { + public AuthenticationProvider authenticationProvider() { DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider(); authenticationProvider.setUserDetailsService(userDetailsService()); @@ -90,7 +92,7 @@ public class ApiSecurityConfig extends WebSecurityConfigurerAdapter { } @Bean - public JuickUserDetailsService userDetailsService() { + public UserDetailsService userDetailsService() { return new JuickUserDetailsService(userService); } -- cgit v1.2.3