Created
July 22, 2014 20:41
-
-
Save zaccone/6e3e91ee251ade7ca758 to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/env python | |
| import pdb | |
| import requests | |
| from keystoneclient.contrib.auth.v3 import saml2 | |
| from keystoneclient import session | |
| from keystoneclient.v3 import client | |
| IDENTITY_PROVIDER = 'testshib' | |
| IDENTITY_PROVIDER_URL = "https://idp.testshib.org/idp/profile/SAML2/SOAP/ECP" | |
| SERVICE_PROVIDER_URL = "https://ltartari2.cern.ch/v3" | |
| username = 'myself' | |
| password = 'myself' | |
| saml2plugin = saml2.Saml2UnscopedToken( | |
| SERVICE_PROVIDER_URL, IDENTITY_PROVIDER, IDENTITY_PROVIDER_URL, | |
| username=username, password=password) | |
| s = session.Session(auth=saml2plugin, verify=False, session=requests.Session()) | |
| kl = client.Client(session=s) | |
| kl.federation.projects.list() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment