-2

I would like to manage the authorizations on my rest API coded in java via the spring boot framework using the most recent spring keycloak libraries but I don't know which ones to use and how to code the configuration.

I tried the spring security adapter keycloak library but this one seems outdated depending on the IDE I use

  • 1
    Does this answer your question? [Use Keycloak Spring Adapter with Spring Boot 3](https://stackoverflow.com/questions/74571191/use-keycloak-spring-adapter-with-spring-boot-3) – ch4mp Jul 31 '23 at 15:22

1 Answers1

1

We have to use official/recommended OAuth2 implementation from Spring, wrapped and provided via Spring Boot Starter if you are using Spring Boot 3.x and Keycloak.

For bearer token based REST APIs:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
</dependency> 

For Spring based UIs:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-oauth2-client</artifactId>
</dependency> 

https://www.keycloak.org/2022/02/adapter-deprecation.html

SwathiP
  • 315
  • 3
  • 5