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
?
End of Life NoticeThe Spring Security OAuth project has reached end of life and is no longer actively maintained by VMware, Inc. This project has been replaced by the OAuth2 support provided by Spring Security and Spring Authorization Server.
The first thing to note is that Spring Security OAuth 2.4. 0 officially deprecates all its classes. The second thing is that according to the Spring Security - OAuth 2.0 Features Matrix - FAQ: We are no longer planning on adding Authorization Server support to Spring Security.
Conclusion. Spring Security and Spring Boot permit to quickly set up a complete OAuth2 authorization/authentication server in an almost declarative manner. The setup can be further shortened by configuring OAuth2 client's properties directly from application. properties/yml file, as explained in this tutorial.
Spring Security OAuth2 − Implements the OAUTH2 structure to enable the Authorization Server and Resource Server. Spring Security JWT − Generates the JWT Token for Web security. Spring Boot Starter JDBC − Accesses the database to ensure the user is available or not. Spring Boot Starter Web − Writes HTTP endpoints.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With