-
Notifications
You must be signed in to change notification settings - Fork 0
5. token exchange
zhoumingjun edited this page Jul 29, 2019
·
1 revision
export host=10.107.1.195
export port=8080
export realm=example
export user1_name=user1
export user1_password=passw0rd
curl -X POST "http://$host:$port/auth/realms/$realm/protocol/openid-connect/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d 'grant_type=password' \
-d 'client_id=client1' \
-d "client_secret=3e068f7d-d03e-420d-ac58-e8ac9560276f" \
-d "username=$user1_name" \
-d "password=$user1_password" | jq .access_token -r | jwt
curl -X POST "http://$host:$port/auth/realms/$realm/protocol/openid-connect/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d 'grant_type=password' \
-d 'client_id=client2' \
-d "username=$user1_name" \
-d "password=$user1_password" | jq .access_token -r | jwt
<<AllPages()>>