-
-
Save zaccone/f067e2036b3044b30382 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/python | |
import json | |
from keystoneclient_saml2.v3 import saml2 | |
from keystoneclient import session | |
import pdb | |
CREDENTIALS = { | |
'auth_url': 'https://keystone-idp:5000/v3', | |
'identity_provider': 'cern', | |
'identity_provider_url': | |
'https://idp.testshib.org/idp/profile/SAML2/SOAP/ECP', | |
'protocol': 'saml2', | |
'username': '', | |
'password': '', | |
'project_name': 'cern', | |
'project_domain_name': 'default', | |
} | |
s = session.Session(verify=False) | |
plugin = saml2.Saml2Token(**CREDENTIALS) | |
access = plugin.get_access(s) | |
print(access.auth_token) | |
print(json.dumps(access._data, indent=2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment