Spring Boot + Keycloak - Securing REST APIs
Hello everyone, Hope you are doing well. In this article, we will learn how to secure the Spring boot REST APIs with Keycloak. The GitHub repository link is provided at the end of this tutorial. Technologies Used: Java 11 Spring Boot 2.5.5 KeyCloak 15.0.2 Maven 3 Step 1: Keycloak - Environment Setup Let's download the Keycloak-15.0.2 Standalone server distribution from the official source. Once we've downloaded the Standalone server distribution, we can unzip and start Keycloak from the terminal: In Windows unzip keycloak-12.0.1.zip cd keycloak-12.0.1/bin/ standalone.bat In Linux / Unix $ sudo tar -xvzf keycloak-12.0.1.tar.gz $ cd keycloak-12.0.1/bin/ $ ./standalone.sh Create Keycloak Server Initial Admin Go to http://localhost:8090/auth/ and fill the form in the Administrator Console part. For the purpose of this exercise, knowledgefactory / password would be enough. Then you should be able to log in to Keycloak Admin Console http://localhost:8080/auth/admin . And,