Keycloak is an Open Source Identity and Access Management. It is used on this project with OpenID Connect.
The keycloak and the identity-service on this repository are just a small part of the groot-mg project.
See the full documentation to understand how all the services run together and how they interact and what functionalities are avaialble.
- Gradle
- Java 21
Build with gradle (build + unit tests):
./gradlew clean build
Before running the ft, it is required to have wiremock and app running, so run:
docker compose -f docker-compose.test.yml up -d --buildRun functional-tests:
./gradlew cucumberTo run the application and the keycloak as a container in docker, run the command:
docker compose up -dMore details in the see Wiki
To be able to debug the application locally, we need to run the mocks with a different parameter, so run via command line:
docker compose -f docker-compose.yml up -d --build keycloak-initThis repository sets up keycloak for local environment, it pre-loads configuration
from realm-export.json and it also creates default users
via keycloak-init.
The default realm loaded via json file contains a realm named groot-mg.
Some clients are loaded via config as well:
groot-mg-web-app: to be used on frontend withPKCEfor user authenticationgroot-mg-identity-app: theidentity-servicehas an endpoint to create users and an endpoint to log in withusernameandpassword, it is only for study proposal.groot-mg-backend: Used on theresource-serversto validate user's tokens and user's roles to allow or block access to certain resources/endpoints.
There are two roles to control the access to the endpoints:
client-user: has a client view of the functionalities.support-user: has an IT support view of the functionalities.
The keycloak-init has a script that creates the following users:
| username | password | role |
|---|---|---|
| client | client-password | client-user |
| support | support-password | support-user |
| IMPORTANT: Never storage plain text users and passwords in a repo, mainly in a public repo. This is here for documentation purpose and in case of someone wants to run it in a local environment. So, this is a portfolio project, so it will be useful to have default/example users to be used. |
|---|