The goal of this sample is to play with Spring Boot
REST API using Spring Security LDAP
.
docker-compose up -d
./mvnw clean spring-boot:run
curl -i localhost:8080/api/public
HTTP/1.1 200
Welcome to the public page!
curl -i localhost:8080/api/private
HTTP/1.1 401
{
"timestamp": "2021-04-04T15:55:52.461+00:00",
"status": 401,
"error": "Unauthorized",
"message": "Unauthorized",
"path": "/api/private"
}
curl -i -u user:password localhost:8080/api/private
HTTP/1.1 200
user, welcome to the private page!
-
To stop app running press
Ctrl+C
-
To stop and remove docker-compose containers, networks and volumes run
docker-compose down -v