|
|
@@ -1,7 +1,5 @@
|
|
|
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;
|
|
|
@@ -28,8 +26,8 @@ import static org.springframework.security.config.Customizer.withDefaults;
|
|
|
@EnableWebFluxSecurity
|
|
|
public class ResourceServerConfig {
|
|
|
|
|
|
- @Value(value = "${anonymousPath.paths}")
|
|
|
- private String anonymousPath;
|
|
|
+ @Resource
|
|
|
+ private AnonymousPathProperties anonymousPath;
|
|
|
|
|
|
@Resource
|
|
|
private AuthorizationManager authorizationManager;
|
|
|
@@ -43,7 +41,7 @@ public class ResourceServerConfig {
|
|
|
http.oauth2ResourceServer().jwt()
|
|
|
.jwtAuthenticationConverter(jwtAuthenticationConverter());
|
|
|
http.authorizeExchange()
|
|
|
- .pathMatchers(getAnonymousPaths()).permitAll()
|
|
|
+ .pathMatchers(anonymousPath.getPaths()).permitAll()
|
|
|
.anyExchange().access(authorizationManager)
|
|
|
.and()
|
|
|
.exceptionHandling()
|
|
|
@@ -58,8 +56,4 @@ public class ResourceServerConfig {
|
|
|
jwtAuthenticationConverter.setJwtGrantedAuthoritiesConverter(new RealmRoleConverter());
|
|
|
return new ReactiveJwtAuthenticationConverterAdapter(jwtAuthenticationConverter);
|
|
|
}
|
|
|
-
|
|
|
- private String[] getAnonymousPaths() {
|
|
|
- return anonymousPath.split(",");
|
|
|
- }
|
|
|
}
|