Spring Security OAuth
最新版本:2.5.1.RELEASE(已停止维护)
The 2.4.0 release officially deprecates all classes. The latest OAuth 2.0 support is provided by Spring Security.
Spring Security OAuth 2.4.0 正式弃用其所有类 See the announcement for further details.
其中很多方法都已经被标注@Deprecated
The Spring Security OAuth project is deprecated. The latest OAuth 2.0 support is provided by Spring Security. See the OAuth 2.0 Migration Guide for further details.
This document contains guidance for moving OAuth 2.0 Clients and Resource Servers from Spring Security OAuth 2.x to Spring Security 5.2.x. Since Spring Security doesn’t provide Authorization Server support, migrating a Spring Security OAuth Authorization Server is out of scope for this document.
<!-- https://mvnrepository.com/artifact/org.springframework.security.oauth/spring-security-oauth2 -->
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.3.8.RELEASE</version>
</dependency>
Spring Cloud Security
最新版本:2.2.5.RELEASE (引入该包需要指定其版本)
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-oauth2</artifactId>
<version>2.2.5.RELEASE</version>
</dependency>
include
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-security -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-security</artifactId>
<version>2.2.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
spring-cloud-security
使用的还是 spring-boot-starter-security
,由于使用的spring-security-oauth2
版本为2.3.4
所以类未被提示弃用
spring security oauth2支持
迁移指南:https://github.com/spring-projects/spring-security/wiki/OAuth-2.0-Migration-Guide
Spring Authorization Server
目前还在开发
<dependency>
<groupId>org.springframework.security.experimental</groupId>
<artifactId>spring-security-oauth2-authorization-server</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-oauth2-resource-server -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-oauth2-client -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-client</artifactId>
</dependency>
https://spring.io/blog/2019/11/14/spring-security-oauth-2-0-roadmap-update