Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.0a0

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.0a0
File Size Uploaded Provenance Actions
httpx_negotiate_sspi-2.0.0a0.tar.gz 7.8 kB Without provenance Details for httpx_negotiate_sspi-2.0.0a0.tar.gz

Built distribution (wheel)

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

Total release size: 14.2 kB

Release files / httpx_negotiate_sspi-2.0.0a0.tar.gz

Download URL httpx_negotiate_sspi-2.0.0a0.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
25243001c1cd43f1a5e3cb4247950060c4ca77db7ba2be4a5b4d27a61cf5cf62
BLAKE2b-256 checksum
How to use checksums
f44e5b30d122411b02216fc6b1ce5abeaf88a42f7db42077b7a9b7ceee9f3dbf
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.0a0-py3-none-any.whl

Download URL httpx_negotiate_sspi-2.0.0a0-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c0a2409a48f66110be5445169c59577561428eb4d198ec3a11e879402c8a9ec
BLAKE2b-256 checksum
How to use checksums
15198fa349b4df43bd7b2bed63cb5eadeb66675d40506c08af60fc43e154cb64
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.0a0

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