Session
- class requests_ecp.Session(idp=None, kerberos=False, username=None, password=None, **kwargs)[source]
Bases:
requests_ecp.session.ECPAuthSessionMixin
,requests.sessions.Session
A
requests.Session
wrapper with default SAML/ECP authentication.To start a
Session
to handle ECP authentication with a particular Identity Provider (IdP) pass theidp
argument with the URL of the ECP endpoint or the IdP. For any individual requests in thisSession
that are redirected to a SAML/Shibboleth authentication page/app theHTTPECPAuth
authorisation plugin will automatically intercept the redirect and invoke a SAML/ECP authorisation workflow:>>> from requests_ecp import Session >>> with Session(idp="https://idp.example.com/SAML/SOAP/ECP") as sess: ... sess.get("https://private.example.com/data")
Methods Summary
ecp_authenticate
(url[, endpoint])Manually authenticate against the endpoint.
Methods Documentation
- ecp_authenticate(url, endpoint=None, **kwargs)[source]
Manually authenticate against the endpoint.
This generates a shibboleth session cookie for the domain of the given URL, which defaults to the endpoint itself.
- Parameters
See also
requests_ecp.ecp.authenticate
For details of the ECP authentication workflow.