Skip to content

Instantly share code, notes, and snippets.

@zaccone
Created July 24, 2015 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zaccone/f067e2036b3044b30382 to your computer and use it in GitHub Desktop.
Save zaccone/f067e2036b3044b30382 to your computer and use it in GitHub Desktop.
#!/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