@@ -195,7 +195,7 @@ get_group_path_by_name() {
195195 local group_name=" $input "
196196 token=$( get_token)
197197
198- response=$( curl -s -k --location --request GET " $( keycloak_url) /auth/ admin/realms/backstage/groups?search=${group_name} " \
198+ response=$( curl -s -k --location --request GET " $( keycloak_url) /admin/realms/backstage/groups?search=${group_name} " \
199199 -H ' Content-Type: application/json' \
200200 -H " Authorization: Bearer $token " 2>&1 )
201201
@@ -221,7 +221,7 @@ get_group_id_by_name() {
221221 group_name=" $1 "
222222 token=$( get_token)
223223
224- response=$( curl -s -k --location --request GET " $( keycloak_url) /auth/ admin/realms/backstage/groups?search=${group_name} " \
224+ response=$( curl -s -k --location --request GET " $( keycloak_url) /admin/realms/backstage/groups?search=${group_name} " \
225225 -H ' Content-Type: application/json' \
226226 -H " Authorization: Bearer $token " 2>&1 )
227227
@@ -269,7 +269,7 @@ assign_parent_group() {
269269 attempt=1
270270 while (( attempt <= max_attempts )) ; do
271271 token=$( get_token)
272- response=" $( curl -s -k --location --request POST " $( keycloak_url) /auth/ admin/realms/backstage/groups/${parent_id} /children" \
272+ response=" $( curl -s -k --location --request POST " $( keycloak_url) /admin/realms/backstage/groups/${parent_id} /children" \
273273 -H ' Content-Type: application/json' -H " Authorization: Bearer $token " \
274274 --data-raw ' {"name":"' " ${child_name} " ' "}' 2>&1 ) "
275275 if [ " ${PIPESTATUS[0]} " -eq 0 ] && ! echo " $response " | grep -q ' error' >& /dev/null; then
@@ -296,7 +296,7 @@ create_group() {
296296 groupname=" g${idx} "
297297 while (( attempt <= max_attempts)) ; do
298298 token=$( get_token)
299- response=" $( curl -s -k --location --request POST " $( keycloak_url) /auth/ admin/realms/backstage/groups" \
299+ response=" $( curl -s -k --location --request POST " $( keycloak_url) /admin/realms/backstage/groups" \
300300 -H ' Content-Type: application/json' -H " Authorization: Bearer $token " \
301301 --data-raw ' {"name":"' " ${groupname} " ' "}' 2>&1 ) "
302302 if [ " ${PIPESTATUS[0]} " -eq 0 ] && ! echo " $response " | grep -q ' error' >& /dev/null; then
@@ -319,7 +319,7 @@ create_group() {
319319 groupname=" g${idx} "
320320 while (( attempt <= max_attempts)) ; do
321321 token=$( get_token)
322- response=" $( curl -s -k --location --request POST " $( keycloak_url) /auth/ admin/realms/backstage/groups" \
322+ response=" $( curl -s -k --location --request POST " $( keycloak_url) /admin/realms/backstage/groups" \
323323 -H ' Content-Type: application/json' -H " Authorization: Bearer $token " \
324324 --data-raw ' {"name":"' " ${groupname} " ' "}' 2>&1 ) "
325325 if [ " ${PIPESTATUS[0]} " -eq 0 ] && ! echo " $response " | grep -q ' error' >& /dev/null; then
@@ -444,7 +444,7 @@ create_user() {
444444 while (( attempt <= max_attempts)) ; do
445445 token=$( get_token)
446446 username=" t${0} "
447- response=" $( curl -s -k --location --request POST " $( keycloak_url) /auth/ admin/realms/backstage/users" \
447+ response=" $( curl -s -k --location --request POST " $( keycloak_url) /admin/realms/backstage/users" \
448448 -H ' Content-Type: application/json' \
449449 -H ' Authorization: Bearer ' " $token " \
450450 --data-raw ' {"firstName":"' " ${username} " ' ","lastName":"tester", "email":"' " ${username} " ' @test.com","emailVerified":"true", "enabled":"true", "username":"' " ${username} " ' ","groups":' " $groups " ' ,"credentials":[{"type":"password","value":"' " ${KEYCLOAK_USER_PASS} " ' ","temporary":false}]}' 2>&1 ) "
@@ -499,7 +499,7 @@ log_token_err() {
499499}
500500
501501keycloak_token () {
502- curl -s -k " $( keycloak_url) /auth/ realms/master/protocol/openid-connect/token" -d username=admin -d " password=$1 " -d ' grant_type=password' -d ' client_id=admin-cli' | jq -r " .expires_in_timestamp = $( python3 -c ' from datetime import datetime, timedelta; t_add=int(30); print(int((datetime.now() + timedelta(seconds=t_add)).timestamp()))' ) "
502+ curl -s -k " $( keycloak_url) /realms/master/protocol/openid-connect/token" -d username=admin -d " password=$1 " -d ' grant_type=password' -d ' client_id=admin-cli' | jq -r " .expires_in_timestamp = $( python3 -c ' from datetime import datetime, timedelta; t_add=int(30); print(int((datetime.now() + timedelta(seconds=t_add)).timestamp()))' ) "
503503}
504504
505505rhdh_token () {
@@ -526,7 +526,7 @@ rhdh_token() {
526526 --data-urlencode " redirect_uri=${REDIRECT_URL} " \
527527 --data-urlencode " scope=openid email profile" \
528528 --data-urlencode " response_type=code" \
529- " $( keycloak_url) /auth/ realms/$REALM /protocol/openid-connect/auth" 2>&1 | tee " $TMP_DIR /auth_url.log" | grep -oE ' action="[^"]+"' | grep -oE ' "[^"]+"' | tr -d ' "' )
529+ " $( keycloak_url) /realms/$REALM /protocol/openid-connect/auth" 2>&1 | tee " $TMP_DIR /auth_url.log" | grep -oE ' action="[^"]+"' | grep -oE ' "[^"]+"' | tr -d ' "' )
530530
531531 execution=$( echo " $AUTH_URL " | grep -oE ' execution=[^&]+' | grep -oE ' [^=]+$' )
532532 tab_id=$( echo " $AUTH_URL " | grep -oE ' tab_id=[^&]+' | grep -oE ' [^=]+$' )
0 commit comments