QRS API Authentication

Authentication management for the QRS API client.

Supports certificate-based and NTLM authentication. NTLM support requires the optional requests_ntlm dependency (install via pip install qrs-api-client[ntlm]).

class qrs_api_client.auth.AuthManager(cert_path=None, key_path=None, root_cert_path=None, user_id=None, password=None)[source]

Bases: object

Manages authentication for connecting to Qlik Sense Enterprise, supporting certificate-based and NTLM authentication.

get_auth(session: Session, auth_method='certificate', verify_ssl=True) Session[source]

Configures the given session with authentication and SSL settings.

Parameters:
  • session – The requests session to configure.

  • auth_method – Either "certificate" or "ntlm".

  • verify_sslTrue/False for SSL verification, or a path to a root CA bundle. If root_cert_path is set on this instance and verify_ssl is truthy, the root cert path is used instead.

Raises:

ValueError – If an unknown authentication method is specified.

get_certificate_auth() tuple[source]

Returns the (cert, key) tuple for certificate-based authentication.

Raises:

ValueError – If cert_path or key_path is not provided.

get_ntlm_auth()[source]

Creates an NTLM authentication object.

Note: Requires the optional requests_ntlm package. Install via:

pip install qrs-api-client[ntlm]

Raises:
  • ImportError – If requests_ntlm is not installed.

  • ValueError – If user_id or password is not provided.