I have spring security jars in non spring project.Which version of spring-security-oauth2 should i use ?Currently i am using 2.3.5 .Is this compatible with spring security core 5.3.4.RELEASE?
I am getting the below error while fetching Outh2 tokens
post request for resulted in 401 (unauthorized) invoking error handler
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.3.4.RELEASE</version>
</dependency>
<dependency>
<artifactId>spring-security-oauth2</artifactId>
<version>2.3.5.RELEASE</version>
</dependency>
Note that spring-security-oauth2
is deprecated in favor of spring-security-oauth2-client
and spring-security-oauth2-resource-server
.
The new dependencies are released along with spring-security-core
. So, if you change to the newer jars, then you can achieve compatibility by choosing the same version number:
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.3.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-oauth2-client</artifactId>
<version>5.3.4.RELEASE</version>
</dependency>
As was already noted by Pale Blue Dot, spring-security-oauth2-client
will bring in spring-security-core
transitively, so you can leave out the spring-security-core
dependency.