Kotlin + Spring Boot + Keycloak - Securing REST APIs
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjq5QLFsQC1Yya3nSMV11nWL9BnLPtWQLR1V-7GSwe1qpXp3HACLpuBjbRbaU3h3TNp33eK_tzYGS-r80A4cN1uPdVxO5MX89Oden-fSJ0oYcamOpC2pu7NpSJwdPbXT4-o8j7nb-SlFZQI/w640-h474/Screenshot+from+2021-09-25+21-13-52.png)
Hello everyone, In this article, we will learn how to secure the Kotlin + Spring boot REST APIs with Keycloak. GitHub repository link is provided at the end of this tutorial. Technologies Used: Kotlin Spring Boot 2.5.5 KeyCloak 15.0.2 Gradle Let's begin our journey, 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 will be enough. Then you should be able to log in to Keycloak Admin Console http://localhost:8080/auth/admin . An