问题
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.
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.
How can I configure my client webapplication for OAuth2 in spring boot versions >= 2.0.0.M6
?
回答1:
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.
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:
This issue is now tracked in GitHub and is available in 2.0.0 SNAPSHOT and targeted for an RC1 release.
View issue here: https://github.com/spring-projects/spring-boot/pull/10672
回答3:
Looks like the @EnableOauth2Sso
annotation has been moved here:
compile group: 'org.springframework.security.oauth.boot', name: 'spring-security-oauth2-autoconfigure', version: 2.0.0.RELEASE
来源:https://stackoverflow.com/questions/47246340/spring-boot-2-0-0-m6-oauth2-web-application-client-no-enableoauth2sso-anymore