diff options
Diffstat (limited to 'juick-api/src/main/java/com')
-rw-r--r-- | juick-api/src/main/java/com/juick/api/configuration/ApiSecurityConfig.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/juick-api/src/main/java/com/juick/api/configuration/ApiSecurityConfig.java b/juick-api/src/main/java/com/juick/api/configuration/ApiSecurityConfig.java index 9f937c98..99731d2a 100644 --- a/juick-api/src/main/java/com/juick/api/configuration/ApiSecurityConfig.java +++ b/juick-api/src/main/java/com/juick/api/configuration/ApiSecurityConfig.java @@ -3,7 +3,8 @@ package com.juick.api.configuration; import com.juick.server.security.JuickAuthenticationEntryPoint; import com.juick.service.UserService; import com.juick.service.security.JuickUserDetailsService; -import com.juick.service.security.SimpleRememberMeServices; +import com.juick.service.security.deprecated.CookieSimpleHashRememberMeServices; +import com.juick.service.security.deprecated.RequestParamHashRememberMeServices; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; @@ -21,6 +22,7 @@ import org.springframework.web.cors.UrlBasedCorsConfigurationSource; import javax.inject.Inject; import java.util.Arrays; +import java.util.Collections; import java.util.concurrent.TimeUnit; /** @@ -77,7 +79,7 @@ public class ApiSecurityConfig extends WebSecurityConfigurerAdapter { @Bean public RememberMeServices rememberMeServices() throws Exception { - return new SimpleRememberMeServices(env.getProperty("auth_remember_me_key"), userService, env); + return new RequestParamHashRememberMeServices(env.getProperty("auth_remember_me_key"), userService); } @Bean @@ -89,9 +91,9 @@ public class ApiSecurityConfig extends WebSecurityConfigurerAdapter { public CorsConfigurationSource corsConfigurationSource() { CorsConfiguration configuration = new CorsConfiguration(); - configuration.setAllowedOrigins(Arrays.asList("*")); + configuration.setAllowedOrigins(Collections.singletonList("*")); configuration.setAllowedMethods(Arrays.asList("POST", "GET", "PUT", "OPTIONS", "DELETE")); - configuration.setAllowedHeaders(Arrays.asList("*")); + configuration.setAllowedHeaders(Collections.singletonList("*")); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); source.registerCorsConfiguration("/**", configuration); |