|
|
@@ -17,7 +17,7 @@ import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder;
|
|
|
import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationConverter;
|
|
|
import org.springframework.security.oauth2.server.resource.authentication.JwtGrantedAuthoritiesConverter;
|
|
|
import org.springframework.security.oauth2.server.resource.authentication.ReactiveJwtAuthenticationConverterAdapter;
|
|
|
-import org.springframework.security.oauth2.server.resource.web.server.authentication.ServerBearerTokenAuthenticationConverter;
|
|
|
+//import org.springframework.security.oauth2.server.resource.web.server.authentication.ServerBearerTokenAuthenticationConverter;
|
|
|
import org.springframework.security.web.server.SecurityWebFilterChain;
|
|
|
import reactor.core.publisher.Mono;
|
|
|
|
|
|
@@ -30,10 +30,10 @@ import java.security.spec.InvalidKeySpecException;
|
|
|
* @author reghao
|
|
|
* @date 2024-11-14 17:39:00
|
|
|
*/
|
|
|
-@Configuration
|
|
|
-@EnableWebFluxSecurity
|
|
|
+//@Configuration
|
|
|
+//@EnableWebFluxSecurity
|
|
|
public class ResourceServerConfig {
|
|
|
- private final CustomReactiveAuthorizationManager customReactiveAuthorizationManager;
|
|
|
+ /*private final CustomReactiveAuthorizationManager customReactiveAuthorizationManager;
|
|
|
private final RedisTemplate<String, String> redisTemplate;
|
|
|
|
|
|
public ResourceServerConfig(CustomReactiveAuthorizationManager customReactiveAuthorizationManager,
|
|
|
@@ -63,10 +63,10 @@ public class ResourceServerConfig {
|
|
|
// 所有的请求都交由此处进行权限判断处理
|
|
|
.anyExchange()
|
|
|
.access(customReactiveAuthorizationManager)
|
|
|
- /*.and()
|
|
|
+ *//*.and()
|
|
|
.exceptionHandling()
|
|
|
.accessDeniedHandler(new CustomServerAccessDeniedHandler())
|
|
|
- .authenticationEntryPoint(new CustomServerAuthenticationEntryPoint())*/
|
|
|
+ .authenticationEntryPoint(new CustomServerAuthenticationEntryPoint())*//*
|
|
|
.and()
|
|
|
.csrf()
|
|
|
.disable()
|
|
|
@@ -74,9 +74,9 @@ public class ResourceServerConfig {
|
|
|
return http.build();
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
+ *//**
|
|
|
* 从jwt令牌中获取认证对象
|
|
|
- */
|
|
|
+ *//*
|
|
|
public Converter<Jwt, ? extends Mono<? extends AbstractAuthenticationToken>> jwtAuthenticationConverter() {
|
|
|
|
|
|
// 从jwt 中获取该令牌可以访问的权限
|
|
|
@@ -93,9 +93,9 @@ public class ResourceServerConfig {
|
|
|
return new ReactiveJwtAuthenticationConverterAdapter(jwtAuthenticationConverter);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
+ *//**
|
|
|
* 解码jwt
|
|
|
- */
|
|
|
+ *//*
|
|
|
public ReactiveJwtDecoder jwtDecoder() {
|
|
|
RSAPublicKey rsaPublicKey = getPublicKey();
|
|
|
ReactiveJwtDecoder jwtDecoder = NimbusReactiveJwtDecoder
|
|
|
@@ -115,5 +115,5 @@ public class ResourceServerConfig {
|
|
|
}
|
|
|
|
|
|
return null;
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|