This project demonstrates how to secure a Spring Boot application using Keycloak, a powerful open-source Identity and Access Management tool.
- Single Sign-On (SSO) with OpenID Connect
- Role-Based Access Control (RBAC)
- Fine-Grained Authorization
- Spring Boot 3.2.0-RC2
- Java 21
- Keycloak Server 22+
- Gradle
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Clone the repository:
git@github.com:hadiubaidillah/demo-spring-boot-3-java-21-keycloak-22.git
- Navigate into the project directory:
cd your-repository-name
- Use Maven to build the project:
mvn clean install
- You can then run the Spring Boot application using:
mvn spring-boot:run
- Run the docker-compose file:
docker-compose up -d
- Navigate to Keycloak Admin UI Console
- Create a new Real and name ut
Hadi
or update theapplication.yml
file and specify your Realm name - Create Roles
- Create Users
- Assign roles to users
TBD
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
This project is licensed under the MIT License - see the LICENSE.md file for details