From be26512cf6aa32b72a1085a01d373fc3fbde1119 Mon Sep 17 00:00:00 2001 From: Khaled <45347802+JavaDeveloper456788@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:13:04 -0800 Subject: [PATCH] Update update-kc.sh --- Keycloak/update-kc.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Keycloak/update-kc.sh b/Keycloak/update-kc.sh index c53d7a1..b137133 100644 --- a/Keycloak/update-kc.sh +++ b/Keycloak/update-kc.sh @@ -55,16 +55,16 @@ done < client_scopes.sh #Create Clients echo -e "CREATE Clients \n" -while read line -do + +jq -c '.[]' clients.sh | while read -r client; do result=$(curl -s -v -w "%{http_code}" -X POST "$KC_BASE_URL/$KC_REALM_ID/clients" \ --header "Authorization: Bearer $TKN" \ --header "Content-Type: application/json" \ - --data-raw "$line") + --data-raw "$client") echo -e " Response : $result\n" - default_scopes=$(echo "$line" | jq -r '.defaultClientScopes[]') - clientId=$(echo "$line" | jq -r '.clientId') - echo -e "line : $line\n" + default_scopes=$(echo "$client" | jq -r '.defaultClientScopes[]') + clientId=$(echo "$client" | jq -r '.clientId') + CLIENT_UUID=$(curl -s -X GET "$KC_BASE_URL/$KC_REALM_ID/clients" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TKN" \