我已经在 Spring 5 和 Spring boot 2.0.0.M3 中构建了一个身份验证服务和 Web 应用程序,现在我正在尝试将其移植到 Spring boot 2.0.0.M6
。
我注意到 @EnableOauth2Sso
在 spring-boot-autoconfigure
中不再可用;我曾使用此注释以 spring boot 2.0.0.M3
方式配置我的 Web 应用程序。我已经查看了 Spring
上的示例,用于使用 @EnableOAuth2Client
配置 Oauth2 Client
但示例中使用的配置对象,例如 UserInfoTokenServices
似乎也不存在了。
如何在 Spring Boot 版本 >= 2.0.0.M6 中为 OAuth2 配置我的客户端 Web 应用程序?
最佳答案
The existing GitHub issue on spring boot ,已经详细说明,最终我被引导到 2.0.0 版本中的注释位置。它已被移至一个对 2.0.0 版本工件全新的项目。
要解决此问题并迁移您的项目,请添加工件 org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure到你的依赖管理配置:
<dependency>
<groupId>org.springframework.security.oauth.boot</groupId>
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
关于Spring Boot 2.0.0.M6 OAuth2 Web 应用程序客户端。不再有@EnableOauth2Sso;如何更换?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47246340/