HTTPECPAuth

class requests_ecp.HTTPECPAuth(idp, kerberos=False, username=None, password=None)[source]

Bases: requests.auth.AuthBase

SAML2/ECP authorisation plugin for requests.

This auth plugin intercepts 302 Found redirect responses that target a SAMLRequest authorisation or a Shibboleth.sso discovery service, and executes a SAML2/ECP workflow against the configured Identity Provider (idp).

Kerberos authentication is supported via the requests GSSAPI module.

>>> from requests import Session
>>> from requests_ecp import HTTPECPAuth
>>> with Session() as sess:
...     sess.auth = HTTPECPAuth(idp="https://idp.example.com/SAML2/SOAP/ECP")
...     sess.get("https://private.example.com/data")

Methods Summary

__call__(request)

Register the response handler

deregister(response)

Deregister the response handler

handle_response(response, **kwargs)

Handle ECP authentication based on a transation response

reset()

Methods Documentation

__call__(request)[source]

Register the response handler

deregister(response)[source]

Deregister the response handler

handle_response(response, **kwargs)[source]

Handle ECP authentication based on a transation response

reset()[source]