This application provides an HTTP service that allows users to create and manage Keycloak realms.
Before running the application, you must have the following installed on your system:
- Docker
- Docker Compose
- Clone the repository:
git clone https://github.com/razlm/legit.git
- Change to the project directory:
cd legit
- Build and run the containers using Docker Compose:
docker-compose up --build
To create a realm, send a POST request to the /create_realm endpoint with the following parameters:
- realm_name: The name of the realm to create.
I've got some issues in the end, you need to exec -it to the flask docker and then run the command - docker ps - docker exec -it [Docker-ID] bash and then:
For example:
curl -X POST http://localhost:5001/create_realm -H 'Content-Type: application/json' -d '{"realm_names": ["myrealmexample"]}'
To create multiple realms, send a POST request to the /create_realms endpoint with the following parameters:
- realm_names: A list of realm names to create.
For example:
curl -X POST http://localhost:5001/create_realm -H 'Content-Type: application/json' -d '{ "realm_names": ["myrealm1", "myrealm2"]}'
To update the password creation policy for all existing realms, send a POST request to the
/update_password_policy endpoint with the following parameters:
- min_length: The minimum length of passwords.
- min_lower: The minimum number of lowercase characters in passwords.
- min_upper: The minimum number of uppercase characters in passwords.
- min_digit: The minimum number of digit characters in passwords.
- min_special: The minimum number of special characters in passwords.
<br/ >
For example:
curl -X POST http://localhost:5001/update_password_policy -d '{"min_length": 8, "min_lower": 1, "min_upper": 1, "min_digit": 1, "min_special": 1}'