Created
June 26, 2015 11:41
-
-
Save hughsaunders/00a58fbb800448258dbf to your computer and use it in GitHub Desktop.
K2K test
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
#!/bin/bash -xe | |
SP_HOST=134.213.145.21 | |
IDP_HOST=134.213.146.67 | |
SP_ID="keystone_sp" | |
IDP_ID="keystone-idp" | |
# 1) get token | |
eval $(openstack token issue -f shell) | |
OS_TOKEN=${id} | |
# 2) get assertion | |
curl -v -s -X POST \ | |
-H "X-Auth-Token: $OS_TOKEN" -H "Content-Type: application/json" \ | |
-d '{"auth": {"scope": {"service_provider": {"id": "'$SP_ID'"}}, "identity": {"token": {"id":"'"$OS_TOKEN"'"}, "methods": ["token"]}}}' \ | |
http://${IDP_HOST}:5000/v3/auth/OS-FEDERATION/saml2/ecp \ | |
> assertion | |
# check assertion | |
xmllint --pretty 1 assertion | |
# 3) Post assertion to sp | |
curl -v http://${SP_HOST}:5000/Shibboleth.sso/SAML2/ECP \ | |
-d @assertion -k \ | |
-H "Content-Type: application/vnd.paos+xml"\ | |
-c cookies.txt | |
# 4) Request federated token | |
curl -v -s -X GET \ | |
-H "Content-Type: application/vnd.paos+xml" \ | |
-b cookies.txt \ | |
http://${SP_HOST}:5000/v3/OS-FEDERATION/identity_providers/${IDP_ID}/protocols/saml2/auth |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment