Securing a Spring Boot Application with Keycloak

Last Update: 3 March 2019

In this article, we’re going to secure a Spring Boot application using Keycloak.

Securing Spring Boot with Keycloak - ThomasVitale.com

Before doing that, let’s briefly recall what we have done so far.

First, we talked about the main features of Keycloak used in this series and learned how to install and boot the Keycloak server.

Then, we set Keycloak with some basic configurations to use it for securing a web application (providing it with authentication and authorization).

In this article, we’re going to learn how to:

    1. Create a client in Keycloak;
    2. Set up the Spring Boot application;
    3. Define the application resources;
    4. Add access policies based on user roles.

You can check out the full source code of the demo project we’re going to build on GitHub.

Let’s get started! Continue reading “Securing a Spring Boot Application with Keycloak”