Skip to content

Instantly share code, notes, and snippets.

@zaccone
Created July 22, 2014 20:41
Show Gist options
  • Select an option

  • Save zaccone/6e3e91ee251ade7ca758 to your computer and use it in GitHub Desktop.

Select an option

Save zaccone/6e3e91ee251ade7ca758 to your computer and use it in GitHub Desktop.
#!/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