Preview:
## You need:
## client_id, secret_id, user, password, realm , keycloak url

access_token=$(curl --silent\
 -d "client_id=client_id" \
-d "client_secret=secret_id" \
-d "username=user" \
-d "password=password" \
-d "grant_type=password" \
"https://keycloak_url/auth/realms/{{realm}}/protocol/openid-connect/token" | jq -r '.access_token')

## show token
echo $access_token
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter