【发布时间】:2021-05-07 20:51:17
【问题描述】:
我刚开始使用 OAuth2 学习 Spring Security,我想为我的微服务 Restful Api 创建授权服务器和资源服务器。但是我很困惑从哪个依赖开始,因为我找到了其中的一些。我使用 spring boot 2.4.1 版本。这里我在下面列出:
这个是我在 spring 初始化页面找到的,当我尝试添加 OAuth2 库时,这个是最新版本吗?
<!-- 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.cloud/spring-cloud-starter-oauth2 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-oauth2</artifactId>
<version>2.2.4.RELEASE</version>
</dependency>
最后一个,是下面这个吗,因为我看不到更新版本了,这个也被弃用了吗?
<!-- 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.5.0.RELEASE</version>
</dependency>
我应该使用哪一个?
【问题讨论】:
标签: java spring spring-boot oauth-2.0 dependencies