Created
August 23, 2024 20:15
-
-
Save akoserwal/5463f9efd18537573bb194ad07fd94ce to your computer and use it in GitHub Desktop.
get-token.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KEYCLOAK_URL=http://0.0.0.0:8084 | |
REALM=test | |
CLIENT_ID=admin-cli | |
USERNAME=admin | |
PASS=admin | |
TOKEN_PATH="/realms/master/protocol/openid-connect/token" | |
RESULT=`curl -sk --data "grant_type=password&client_id=$CLIENT_ID&username=$USERNAME&password=$PASS" $KEYCLOAK_URL$TOKEN_PATH` | |
TOKEN=$(jq -r '.access_token' <<< $RESULT) | |
echo $TOKEN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment