File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
applications/accounts/scripts Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -4,20 +4,20 @@ NAMESPACE=${CH_ACCOUNTS_REALM}
44USERNAME=admin_api
55PASSWORD=$( cat /opt/cloudharness/resources/auth/api_user_password)
66
7- set -e
87echo " Checking if API user exists..."
98
109# Check if user already exists
1110if /opt/keycloak/bin/kcadm.sh get users -q " username=$USERNAME " | grep -q " $USERNAME " ; then
12- echo " API user $USERNAME already exists, skipping creation"
11+ echo " API user $USERNAME already exists, syncing password to the one in the secret"
12+ /opt/keycloak/bin/kcadm.sh set-password --username " $USERNAME " --new-password " $PASSWORD "
1313 exit 0
1414fi
1515
1616echo " Creating API user $USERNAME "
1717
1818# create the user and reload keycloak
1919/opt/keycloak/bin/kcadm.sh create users -s " username=$USERNAME " -s enabled=True
20- /opt/keycloak/bin/kcadm.sh set-password --username " $USERNAME " --new-password " $PASSWORD "
20+
2121/opt/keycloak/bin/kcadm.sh add-roles --uusername " $USERNAME " --rolename admin
2222
2323echo " API user created successfully"
You can’t perform that action at this time.
0 commit comments