java – 使用带有oauth2的spring cloud gateway

i face a problem when i using spring cloud gateway

is if any dependency call spring-boot-starter-tomcat directly or recursively

it will not work because it will start the embedded tomcat server not the netty server that spring cloud gateway use

我开始通过排除这种依赖性来解决这个问题

        

the spring cloud gateway worked successfully

but sometimes i want to use spring-cloud-starter-oauth2 to use @EnableOAuth2Sso

我开始使用

    

at that time i face the big issue that throw exception saying

Caused by: java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.security.oauth2.config.annotation.web.configuration.OAuth2ClientConfiguration
……

Caused by: java.lang.NoClassDefFoundError: javax/servlet/Filter

最佳答案
正如您所见,Spring云网关使用反应模型,而不是基于netty而不是tomcat.反应性变化是一个重大转变,目前Spring Security不支持,但工作正在进行中,您可以在https://github.com/spring-cloud/spring-cloud-gateway/issues/179跟踪它

相关文章

这篇文章主要介绍了spring的事务传播属性REQUIRED_NESTED的原...
今天小编给大家分享的是一文解析spring中事务的传播机制,相...
这篇文章主要介绍了SpringCloudAlibaba和SpringCloud有什么区...
本篇文章和大家了解一下SpringCloud整合XXL-Job的几个步骤。...
本篇文章和大家了解一下Spring延迟初始化会遇到什么问题。有...
这篇文章主要介绍了怎么使用Spring提供的不同缓存注解实现缓...