improve script
This commit is contained in:
parent
f8b4e21acc
commit
376d808223
|
@ -36,10 +36,11 @@ result=$(curl -s -X POST "$KEYCLOAK_URL" "$INSECURE" \
|
||||||
-d "password=$PASSWORD" \
|
-d "password=$PASSWORD" \
|
||||||
-d 'grant_type=password' \
|
-d 'grant_type=password' \
|
||||||
-d "client_id=$CLIENT_ID")
|
-d "client_id=$CLIENT_ID")
|
||||||
TOKEN=$(jq -r '.access_token' <<< "$result")
|
|
||||||
|
|
||||||
echo TOKEN: $TOKEN
|
token=$(jq -r '.access_token' <<< "$result")
|
||||||
|
|
||||||
if [[ $(echo $TOKEN) != 'null' ]]; then
|
if [[ "$token" != 'null' ]]; then
|
||||||
export KEYCLOAK_TOKEN=$TOKEN
|
echo "token: $token"
|
||||||
|
else
|
||||||
|
echo "Failed auth result: $result"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue