-
Notifications
You must be signed in to change notification settings - Fork 0
6. vault
zhoumingjun edited this page Jul 29, 2019
·
1 revision
export host=10.107.1.195
export port=8080
export realm=vault
export user1_name=user1
export user1_password=passw0rd
export user2_name=demo
export user2_password=demo
export client_vault=vault
export client_vault_secret=5c7146ab-4ca6-44ef-b510-e71e5d77ecc9
export client_kms=kms
export client_kms_secret=68dc51c0-2f51-4b6c-819a-ff91a4aa0356
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=$client_vault" \
-d "client_secret=$client_vault_secret" \
-d "scope=openid" \
-d "username=$user1_name" \
-d "password=$user1_password" | jq .access_token -r | jwt
id_token=`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=$client_vault" \
-d "client_secret=$client_vault_secret" \
-d "scope=openid" \
-d "username=$user1_name" \
-d "password=$user1_password" | jq .id_token -r`
id_token=`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=$client_kms" \
-d "client_secret=$client_kms_secret" \
-d "scope=openid" \
-d "username=$user1_name" \
-d "password=$user1_password" | jq .id_token -r`
jwt $id_token<<AllPages()>>