Skip to main content

Python SPNEGO Library

Test workflow codecov PyPI version License

Library to handle SPNEGO (Negotiate, NTLM, Kerberos) and CredSSP authentication. Also includes a packet parser that can be used to decode raw NTLM/SPNEGO/Kerberos tokens into a human readable format.

Requirements

See How to Install for more details

Optional Requirements

The following Python libraries can be installed to add extra features that do not come with the base package:

How to Install

To install pyspnego with all basic features, run

pip install pyspnego

Kerberos Authentication

While pyspnego supports Kerberos authentication on Linux, it isn't included by default due to its reliance on system packages to be present.

To install these packages, run the below

# Debian/Ubuntu
apt-get install gcc python3-dev libkrb5-dev

# Centos/RHEL/Fedora
dnf install gcc python-devel krb5-devel

# Arch Linux
pacman -S gcc krb5

Once installed you can install the Python packages with

pip install pyspnego[kerberos]

Kerberos also needs to be configured to talk to the domain but that is outside the scope of this page.

How to Use

See the examples section for examples on how to use the authentication side of the library.

Note: While server/acceptor authentication is available for all protocols it is highly recommended you have the system GSSAPI and NTLM system libraries present for acceptor authentication. Pyspnego NTLM acceptor authentication should work but it is not as thoroughly tested as the GSSAPI implementation.

CredSSP Authentication

Since version 0.2.0, pyspnego can be used for CredSSP authentication. While this isn't part of the SPNEGO/Negotiate protocol it uses common features and code like ASN.1 structures and even Negotiate auth as part of the CredSSP process. Both initiate and accept usages are supported when specifying protocol='credssp' but there are no guarantees the acceptor is free of any bugs so use with caution.

Backlog

  • Add support for anonymous authentication
  • See if pywinrm wants to use this

Metadata

Release files for pyspnego 0.12.4

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

Source distribution (sdist)

Source distribution for pyspnego 0.12.4
File Size Uploaded
pyspnego-0.12.4.tar.gz 235.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyspnego 0.12.4
File Interpreter ABI Platform
pyspnego-0.12.4-py3-none-any.whl Python 3 none any Details

Total release size: 366.4 kB

Release files / pyspnego-0.12.4.tar.gz

Download URL pyspnego-0.12.4.tar.gz
Size 235.4 kB
Tags Source
SHA-256 checksum
How to use checksums
acb314d6ca5c9ce87994b1eebbe2d8b687e0d564f9d650b306afb4c8f9c2ffd5
BLAKE2b-256 checksum
How to use checksums
4b58d7c9cfdf1394a8b4d85ac488888814b28d26c4bd732191bd4169687cbfdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / pyspnego-0.12.4-py3-none-any.whl

Download URL pyspnego-0.12.4-py3-none-any.whl
Size 131.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a29a34de1abe9e9b30d9aa1d363f8e49fc159eb7355b1f2ee86ccb3a2ce3bba9
BLAKE2b-256 checksum
How to use checksums
eb4ef6c1bb147890f246c3a24ce836be4f6cfc44fd7be08e0a229e3a1c08b560
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.12.4 This release

2 release files

0.12.3

2 release files

0.12.2

2 release files

0.11.2

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.2

14 release files

0.9.1

12 release files

0.9.0

12 release files

0.8.0

12 release files

0.7.0

12 release files

0.6.2

12 release files

0.6.1

12 release files

0.6.0

10 release files

0.5.4

12 release files

0.5.3

12 release files

0.5.2

12 release files

0.5.1

12 release files

0.5.0

12 release files

0.4.0

12 release files

0.3.1

12 release files

0.3.0

12 release files

0.2.0

10 release files

0.1.5

14 release files

0.1.3

14 release files

0.1.2

12 release files

0.1.0

12 release files

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