Skip to main content

Windows Negotiate Authentication Client and Server

Project description

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

Project details


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.0.tar.gz (225.8 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.0-py3-none-any.whl (130.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyspnego-0.12.0.tar.gz
  • Upload date:
  • Size: 225.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyspnego-0.12.0.tar.gz
Algorithm Hash digest
SHA256 e1d9cd3520a87a1d6db8d68783b17edc4e1464eae3d51ead411a51c82dbaae67
MD5 f1e4eb073641fc00dfd0ce053963c73b
BLAKE2b-256 f9e48b32a91aeba6fbc6943a630c44b2fe038615e5c7dec8814316fafdcf4bf4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspnego-0.12.0.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.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for pyspnego-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 84cc8dae6ad21e04b37c50c1d3c743f05f193e39498f6010cc68ec1146afd007
MD5 4a17d3f6354b26c4e275bc095fc9f025
BLAKE2b-256 01e995430b8f3b747ebd3b86a66484a79ef387167655bcb15ab416f563045565

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspnego-0.12.0-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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page