This is a sandbox / sample project to illustrate this blog article, part of our Keycloak series.
- Java 11
- JUnit 5
- Spring Boot 2.4.2
- Keycloak 12.0.2
- Start your Keycloak server before running the app
- Create a demo realm working with this app
- Import the provided realm-export.json
- 👉 Or follow How to create a realm for this sample project
- Create 2 users
- One ineat-admin/passwordwithADMINrole associated
- One ineat-user/passwordWithUSERrole associated
 
- One 
- For test :
mvn clean test- To run the app :
mvn spring-boot:run- Use the provided postman_collection_v2.json
- Generate an access_tokenthanks to theKEYCLOAK request TOKEN for USERorKEYCLOAK request TOKEN for ADMIN
- Use this access_tokenasBearerto call the protected/useror/adminendpoints thanks to theRequest /user pathorRequest /admin path
 
- Generate an