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
/password
withADMIN
role associated - One
ineat-user
/password
WithUSER
role 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_token
thanks to theKEYCLOAK request TOKEN for USER
orKEYCLOAK request TOKEN for ADMIN
- Use this
access_token
asBearer
to call the protected/user
or/admin
endpoints thanks to theRequest /user path
orRequest /admin path
- Generate an