Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

spring-boot-starter-oauth2-resource-server vs spring-cloud-starter-oauth2 which to use?

i just getting started to learning Spring Security with OAuth2 and i want to create Authorization Server and Resource Server for my microservice Restful Api. But i am confuse which dependency to start with, since i found some of them. i use spring boot 2.4.1 version. here i list it below :

This one i found it at spring initializer page, when i try to add OAuth2 library, is this one the latest version?

<!-- 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>

below this one i found it at some tutorial, which is i think this one is already deprecated right?

<!-- 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>

And last one, is this one below, since i don't see there is an updated version anymore, is this one deprecated too?

<!-- 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>

which one should i use?

like image 286
Ke Vin Avatar asked Oct 26 '25 01:10

Ke Vin


1 Answers

Spring Boot 2.4.x uses Spring Security 5.4.x, which sadly removed its support for authorization servers.

There's a new project, spring-authorization-sever, aimed at bringing it back in the future, but currently it's only at version 0.0.3.

If you need it for your project, I'd recommend using spring boot 2.3.x instead.

like image 135
dyslexit Avatar answered Oct 28 '25 15:10

dyslexit



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!