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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyspnego-0.12.2.tar.gz (226.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyspnego-0.12.2-py3-none-any.whl (130.2 kB view details)

Uploaded Python 3

File details

Details for the file pyspnego-0.12.2.tar.gz.

File metadata

  • Download URL: pyspnego-0.12.2.tar.gz
  • Upload date:
  • Size: 226.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyspnego-0.12.2.tar.gz
Algorithm Hash digest
SHA256 448a491a9bf0e5fb957567fe46e6809fa836aa40dfcccebcc740bb64acb1be1c
MD5 2af96f8b2faaa4c35026332382c1b5bc
BLAKE2b-256 03c4790211e7a2180509dc29137c488c7b038ef89bdf83db0ce4da802f64f9d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspnego-0.12.2.tar.gz:

Publisher: ci.yml on jborean93/pyspnego

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyspnego-0.12.2-py3-none-any.whl.

File metadata

  • Download URL: pyspnego-0.12.2-py3-none-any.whl
  • Upload date:
  • Size: 130.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyspnego-0.12.2-py3-none-any.whl
Algorithm Hash digest
SHA256 04e7c9260ced15197b3f42b891ffa30fa98c37bb09372c5c2bf927bcdfe30b53
MD5 fb7fdf0e2a125808e27124a900d59659
BLAKE2b-256 0e8c3d0154b8781a371ef1b791063da5a223187dd17738c5b188edc5e9657f9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspnego-0.12.2-py3-none-any.whl:

Publisher: ci.yml on jborean93/pyspnego

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.12.2 This release

2 files

0.12.1

2 files

0.12.0

2 files

0.11.2

2 files

0.11.1

2 files

0.11.0

2 files

0.10.2

2 files

0.10.1

2 files

0.10.0

2 files

0.9.2

14 files

0.9.1

12 files

0.9.0

12 files

0.8.0

12 files

0.7.0

12 files

0.6.3

12 files

0.6.2

12 files

0.6.1

12 files

0.6.0

10 files

0.5.4

12 files

0.5.3

12 files

0.5.2

12 files

0.5.1

12 files

0.5.0

12 files

0.4.0

12 files

0.3.1

12 files

0.3.0

12 files

0.2.0

10 files

0.1.6

14 files

0.1.5

14 files

0.1.4

14 files

0.1.3

14 files

0.1.2

12 files

0.1.1

12 files

0.1.0

12 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