Spring Boot | LDAP | REST API
Implementing and Securing a Simple Spring Boot REST API with LDAP
Step-by-step guide on implementing Simple API application and securing it with LDAP
In this article, we will implement a Simple Spring Boot API, called Simple API, and securing it with LDAP (OpenLDAP). The application contains just two endpoints, /public
and /secured
.
LDAP (Lightweight Directory Access Protocol) is a protocol used for accessing and maintaining distributed directory information services.
OpenLDAP is an open-source implementation of the LDAP protocol. It provides a server and client software suite for managing directory services.
Let’s get started!
Prerequisites
If you would like to follow along, you must have Java 17+ and Docker installed on your machine.
Creating Simple API Spring Boot app
Let’s create a Spring-Boot application using Spring Initializr.
The application name will be simple-api
and the following dependencies: Spring Web
and Spring Security
. We will use the Spring Boot version 3.2.4
and Java 17
. Here is the link that contains all the setup…