|
|
@@ -1,6 +1,9 @@
|
|
|
package com.inspur.smsb.gateway.config;
|
|
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import lombok.Setter;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
import org.springframework.core.convert.converter.Converter;
|
|
|
@@ -13,18 +16,25 @@ import org.springframework.security.oauth2.server.resource.authentication.Reacti
|
|
|
import org.springframework.security.web.server.SecurityWebFilterChain;
|
|
|
import reactor.core.publisher.Mono;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
import static org.springframework.security.config.Customizer.withDefaults;
|
|
|
|
|
|
/**
|
|
|
* 资源服务器配置
|
|
|
*/
|
|
|
-@AllArgsConstructor
|
|
|
+@Slf4j
|
|
|
@Configuration
|
|
|
@EnableWebFluxSecurity
|
|
|
public class ResourceServerConfig {
|
|
|
|
|
|
+ @Value(value = "${anonymousPath.paths}")
|
|
|
+ private String anonymousPath;
|
|
|
+
|
|
|
+ @Resource
|
|
|
private AuthorizationManager authorizationManager;
|
|
|
|
|
|
+ @Resource
|
|
|
private CustomServerAccessDeniedHandler customServerAccessDeniedHandler;
|
|
|
|
|
|
@Bean
|
|
|
@@ -50,16 +60,6 @@ public class ResourceServerConfig {
|
|
|
}
|
|
|
|
|
|
private String[] getAnonymousPaths() {
|
|
|
- return new String[] {
|
|
|
- "/ad/user/**",
|
|
|
- "wxapplet/user/data",
|
|
|
- "wxapplet/openid",
|
|
|
- "wxapplet/userPhoneNumber",
|
|
|
- "wxapplet/getToken/{code}",
|
|
|
- "ai/audit/**",
|
|
|
- "/applet/**",
|
|
|
- "/notice/**",
|
|
|
- "/wxpay/**",
|
|
|
- "/websocket/**"} ;
|
|
|
+ return anonymousPath.split(",");
|
|
|
}
|
|
|
}
|