ntlm-auth is a Python library designed to create NTLM authentication structures, supporting NTLMv1 and NTLMv2, MIC for message integrity, channel binding tokens, and message signing/sealing. The current version is 1.5.0, with releases occurring periodically to add features and improve compatibility, though not on a strict schedule.
pip install ntlm-authVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates the three-step NTLM authentication handshake using the `NtlmContext` class: creating a Type 1 Negotiate message, processing a (simulated) Type 2 Challenge message from the server, and generating a Type 3 Authenticate message. In a real application, the Type 2 message bytes would be received from the server.
Migrate your code to use `ntlm_auth.ntlm.NtlmContext` instead of `ntlm_auth.ntlm.Ntlm`. Review the `NtlmContext` documentation for new methods and properties.
Install the library with the `ntlm_context` extra: `pip install ntlm-auth[ntlm_context]`.
Upgrade your Python environment to a supported version (e.g., Python 3.6+ is generally safe, but always check current PyPI metadata for `requires_python`).
Upgrade to `ntlm-auth` version 1.5.0 or newer to access the latest NTLM functionality.
Install the library using pip: `pip install ntlm-auth`
Install the missing dependency: `pip install cryptography`
Install the 'requests-ntlm' package: `pip install requests-ntlm`
Verify the username, password, and domain are correct. Ensure the server supports the NTLM compatibility level being used by 'ntlm-auth' (default is NTLMv2). Check server logs for more specific NTLM authentication failure details.