Hi all
today, when creating a new server we are running a script that is responsible for the following things:
create a master admin user
import a new realm named devRealm from a realm.json file
create a new user named user1 for devRealm
set a password for that user and set role and group
this is the script:
#!/bin/sh
export PATH=$PATH:/opt/jboss/keycloak/bin/
kcadm.sh config credentials --server http://localhost:8080/auth --realm master --user admin --password 12345
kcadm.sh create realms -s realm=devRealm -s enabled=true -f realm.json
USER_ID=$(kcadm.sh create users -r devRealm -s username=user1 -s enabled=true 2>&1 | grep -Ewo β[[:xdigit:]]{8}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}β)
echo USER_ID=$USER_ID
kcadm.sh set-password -r devRealm --username user1 --new-password 12345
kcadm.sh add-roles --uusername user1 --rolename Administrators -r devRealm
kcadm.sh update users/$USER_ID/groups/775edba1-94cc-4d2a-b25f-490df79f55fe -r devRealm -n
Now, from time to time we are doing some changes to the realm.json fille (like adding new groups, roles, mapper, etc.)
Is there a way to run a script like this one to import the new realm.json file into an EXISTING KC ?
we donβt want to manually make those changes every time. we just want to update the json file in the machine and run a script to import it.
Any help would be applicated