春季启动2.0.0.M6 OAuth2 Web应用程序客户端.没有@ EnableOauth2Sso了;怎么更换? [英] Spring boot 2.0.0.M6 OAuth2 web application client. No @EnableOauth2Sso anymore; how to replace?
问题描述
我已经在Spring 5和Spring boot 2.0.0.M3中构建了一个身份验证服务和Web应用程序,我现在尝试将其移植到Spring boot 2.0.0.M6
.
I have build a Authentication Service and Webapplication in Spring 5 and Spring boot 2.0.0.M3 and I am trying to port it to Spring boot 2.0.0.M6
now.
我注意到@EnableOauth2Sso
在spring-boot-autoconfigure
中不再可用;我已使用此批注以spring boot 2.0.0.M3
方式配置我的Web应用程序.我已经研究了Spring
上的示例,用于使用@EnableOAuth2Client
配置Oauth2 Client
,但是示例中使用的Configuration对象(例如UserInfoTokenServices
)似乎也不再存在.
I noticed the @EnableOauth2Sso
is not available anymore in spring-boot-autoconfigure
; I had used this annotation to configure my web application in spring boot 2.0.0.M3
fashion. I have looked into the examples on Spring
for configurating the Oauth2 Client
using @EnableOAuth2Client
but the Configuration objects used in the examples like UserInfoTokenServices
also do not seem to exist anymore.
如何为OAuth2 in spring boot versions >= 2.0.0.M6
配置客户端Web应用程序?
How can I configure my client webapplication for OAuth2 in spring boot versions >= 2.0.0.M6
?
推荐答案
The existing GitHub issue on spring boot, has been elaborated on, and I was eventually led to the annotation's location in the 2.0.0 release. It has been moved to a project completely new to the 2.0.0 release artifacts.
要解决此问题并迁移项目,请添加工件将org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure 设置为您的依赖项管理配置:
To resolve this issue and migrate your project, add the artifact org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure to your dependency management configuration:
<dependency>
<groupId>org.springframework.security.oauth.boot</groupId>
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
这篇关于春季启动2.0.0.M6 OAuth2 Web应用程序客户端.没有@ EnableOauth2Sso了;怎么更换?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!