ECPAuthSessionMixin#

class requests_ecp.ECPAuthSessionMixin(idp=None, kerberos=False, username=None, password=None, **kwargs)[source]#

Bases: object

A mixin for requests.Session to add default ECP Auth.

This creates a default auth attribute on created Session objects as an instance of the HTTPECPAuth authorisation plugin:

from requests import Session
from requests_ecp import ECPAuthSessionMixin
class MySession(ECPAuthSessionMixin, Session):
    pass

This can be mixed with any other Session mixins, but beware of the inheritance order that may impact which mixin preserves the final auth attribute.

See also

requests_ecp.Session

For a ready-made wrapped Session.