Skip to content

little-pinecone/keycloak-spring-boot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

keycloak-spring-boot

keep_growing logo

About this project

This project shows an example integration of Spring Boot with Keycloak.

Prerequisites

Getting started

First, clone this repository.

Then, build it locally with:

mvn clean install

You can run the app in a command line with the following command:

mvn spring-boot:run

Running tests

You can run tests with:

mvn test

Running Keycloak

Run the keycloak service with the following commands:

cd docker
docker compose up -d

Credentials

Below you'll find a list of default user accounts.

Keycloak admin

  • username: keycloak
  • password: keycloak

Default users

  • usernames: christina, hanna, carlo, noel
  • password: test
  • realm role: user

Visit Keycloak

API documentation

Swagger UI

Swagger UI is available at http://localhost:8080/swagger-ui.html. The Keycloak client details are available in the application.properties file:

  • client_id: spring-boot-example-app
  • client_secret: QjLCjk1I9sugcZSDFCsyAkoLOqAHDLKC

Swagger UI screenshot

OpenAPI

http://localhost:8080/v3/api-docs

Postman

The Postman collection for the API is publicly available1, click the button below and select the localhost environment:

Run in Postman

Postman collection screenshot

The authorization config used in the collection is described in the Kecloak in Docker #7 – How to authorize requests via Postman post

Built With

Footnotes

  1. Clicking the Run in Postman button navigates to the page where you can fork the collection to your workspace. Forking the collection into your workspace will enable you to contribute to the source collection using pull requests. You can also view the collection in a public workspace if you like and even import a copy of the collection using the links present on the screen.

About

Demo Spring Boot app showing security config with Keycloak

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published