Skip to main content

httpx-negotiate-sspi

image

This is a port of requests-negotiate-sspi for httpx/httpx2.

The implementation stays close to the original, in an attempt to make any fixes or updates more straightforward.

The following is taken from the README of the original package with changes to reflect httpx.


An implementation of HTTP Negotiate authentication for Requests. This module provides single-sign-on using Kerberos or NTLM using the Windows SSPI interface.

This module supports Extended Protection for Authentication (aka Channel Binding Hash), which makes it usable for services that require it, including Active Directory Federation Services.

Installation

To install you must specify either httpx or httpx2. For example:

pip install httpx-negotiate-sspi[httpx]

or

pip install httpx-negotiate-sspi[httpx2]

Usage

import httpx
from httpx_negotiate_sspi import HttpSspiAuth

r = httpx.get('https://iis.contoso.com', auth=HttpSspiAuth())

When the server advertises both Negotiate and NTLM, Negotiate is preferred. If Negotiate is not offered, NTLM is used when available. This selects the HTTP authentication scheme, not the underlying mechanism: SSPI's Negotiate package can use either Kerberos or NTLM.

Options

  • username: Username.
    Default: None

  • password: Password.
    Default: None

  • domain: NT Domain name.
    Default: '.' for local account.

  • service: Kerberos Service type for remote Service Principal Name.
    Default: 'HTTP'

  • host: Host name for Service Principal Name.
    Default: Extracted from request URI

  • delegate: Indicates that the user's credentials are to be delegated to the server. Default: False

  • scheme: HTTP authentication scheme: "auto", "Negotiate", or "NTLM". Default: "auto" (prefer Negotiate, otherwise NTLM). An explicit scheme is used only if the server advertises it; otherwise an HTTPError is raised without attempting a different scheme. Invalid option values raise ValueError at construction. For example, HttpSspiAuth(scheme="NTLM") selects NTLM even when Negotiate is also offered. Selecting "Negotiate" does not force Kerberos; SSPI may still negotiate NTLM.

If username and password are not specified, the user's default credentials are used. This allows for single-sign-on to domain resources if the user is currently logged on with a domain account.

Metadata

Release files for httpx-negotiate-sspi 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for httpx-negotiate-sspi 2.0.0
File Size Uploaded Provenance Actions
httpx_negotiate_sspi-2.0.0.tar.gz 7.8 kB Without provenance Details for httpx_negotiate_sspi-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for httpx-negotiate-sspi 2.0.0
File Interpreter ABI Platform Actions
httpx_negotiate_sspi-2.0.0-py3-none-any.whl Python 3 none any Details for httpx_negotiate_sspi-2.0.0-py3-none-any.whl

Total release size: 14.2 kB

Release files / httpx_negotiate_sspi-2.0.0.tar.gz

Download URL httpx_negotiate_sspi-2.0.0.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
328e8d278cf7cc0ed34cbec823662464c0d8f89c247a4e35b9b720e5a1680ae0
BLAKE2b-256 checksum
How to use checksums
9ea96605025545915d11d32ff78d43c3c80d6e95ab39632a5556dfe60ea33437
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / httpx_negotiate_sspi-2.0.0-py3-none-any.whl

Download URL httpx_negotiate_sspi-2.0.0-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10a8fba5f4138272dd946fd93352b77a02dbec8c5fc8709cec3429cfebb37d32
BLAKE2b-256 checksum
How to use checksums
4fc38ba9b1df0a2fbb8f6b38beac0134ad2147fad409ae2a46175fb02dfff047
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for httpx-negotiate-sspi 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page