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
yum install gcc python-devel krb5-devel

# 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.

While NTLM auth works out of the box, it is recommended to install the gss-ntlmssp library for full Negotiate support. This can be done with

# Debian/Ubuntu
apt-get install gss-ntlmssp

# Centos/RHEL
yum install gssntlmssp

# Fedora
dnf install gssntlmssp

# Arch Linux
# AUR package https://aur.archlinux.org/packages/gss-ntlmssp/

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.6.0.tar.gz (200.6 kB view details)

Uploaded Source

Built Distributions

pyspnego-0.6.0-py3-none-any.whl (124.7 kB view details)

Uploaded Python 3

pyspnego-0.6.0-cp310-cp310-win_amd64.whl (235.0 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyspnego-0.6.0-cp310-cp310-win32.whl (219.2 kB view details)

Uploaded CPython 3.10 Windows x86

pyspnego-0.6.0-cp39-cp39-win_amd64.whl (237.5 kB view details)

Uploaded CPython 3.9 Windows x86-64

pyspnego-0.6.0-cp39-cp39-win32.whl (221.2 kB view details)

Uploaded CPython 3.9 Windows x86

pyspnego-0.6.0-cp38-cp38-win_amd64.whl (238.5 kB view details)

Uploaded CPython 3.8 Windows x86-64

pyspnego-0.6.0-cp38-cp38-win32.whl (221.7 kB view details)

Uploaded CPython 3.8 Windows x86

pyspnego-0.6.0-cp37-cp37m-win_amd64.whl (235.7 kB view details)

Uploaded CPython 3.7m Windows x86-64

pyspnego-0.6.0-cp37-cp37m-win32.whl (218.9 kB view details)

Uploaded CPython 3.7m Windows x86

File details

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

File metadata

  • Download URL: pyspnego-0.6.0.tar.gz
  • Upload date:
  • Size: 200.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyspnego-0.6.0.tar.gz
Algorithm Hash digest
SHA256 15cd6d3fc4d18b4b7f80259bfab1580c87dc9677d47e7cf801dad71dc23d1afc
MD5 4ddb1d7714ac3d6df5b651a196d2d232
BLAKE2b-256 d94f3e4985ffd0d5956bfab25915a81d3572095feb1cb852d15bc3ff1ffc65a1

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 124.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyspnego-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa2946ba5059f79d13cb8c47e83474de55569c16ed8f953cc47a24dda6f38f57
MD5 cbe952ba98f96482d8a97058d569ea23
BLAKE2b-256 1bc6e58a26d7e9d7a860826c82aa712d47537d63db7cab8fa92d0e24997b4224

See more details on using hashes here.

Provenance

File details

Details for the file pyspnego-0.6.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyspnego-0.6.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 235.0 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyspnego-0.6.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 210a2248060a2d789a333f7553a1a478d21812f675c507393169143cbf038d9b
MD5 c15e8b3a081733a2b2a16ab963b36dc2
BLAKE2b-256 dd9b346cd6862e1186a8486eed36c2292eca68f33f2a221b490ba7879219c146

See more details on using hashes here.

Provenance

File details

Details for the file pyspnego-0.6.0-cp310-cp310-win32.whl.

File metadata

  • Download URL: pyspnego-0.6.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 219.2 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyspnego-0.6.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 53d30afbef1255cb1a8930c14604184b07f989b6ac295a1397eac8c27fd59d8b
MD5 d5393ac5c9d70a31c10fe889d84b2ab7
BLAKE2b-256 c4e860e4908ae82780ddecdb36243c25d37baaf2306c12a587961746c4056e35

See more details on using hashes here.

Provenance

File details

Details for the file pyspnego-0.6.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyspnego-0.6.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 237.5 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyspnego-0.6.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ea8570c5363e5dd359aaf599eac6f70116e0ada734ebe557e17cc608c8bb93fc
MD5 fe0e7679b2ca9c4d7c240de0d1bb0310
BLAKE2b-256 03eea74b2adc7af508dae56f53efbd2bb7a775330bb6470ecac92f33517be1c3

See more details on using hashes here.

Provenance

File details

Details for the file pyspnego-0.6.0-cp39-cp39-win32.whl.

File metadata

  • Download URL: pyspnego-0.6.0-cp39-cp39-win32.whl
  • Upload date:
  • Size: 221.2 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyspnego-0.6.0-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 b78a3370ace76209a52dc7816636a8c8437e323637eefe86a2193cc4ec352b3b
MD5 e33b1fd95a1ab9a2db131d759e12e095
BLAKE2b-256 b33b8eaf1eb65de007a5eae9344295e2d36ce145cab5df6191b501082c777b08

See more details on using hashes here.

Provenance

File details

Details for the file pyspnego-0.6.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pyspnego-0.6.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 238.5 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyspnego-0.6.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 4fab51afb757be21d543ddf78aaeb83db600a7e7daec773568db90d4b7499a2c
MD5 3b3000127dda62b84dce5608f15d53d3
BLAKE2b-256 474430a15b99e6e0ca72ffab15c3313e04c5b344afa545a6c0b40d816c18342a

See more details on using hashes here.

Provenance

File details

Details for the file pyspnego-0.6.0-cp38-cp38-win32.whl.

File metadata

  • Download URL: pyspnego-0.6.0-cp38-cp38-win32.whl
  • Upload date:
  • Size: 221.7 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyspnego-0.6.0-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 e08709c4e0838bf37d4ef8ceff2163a51abe2b071e285bb5774de5b73eab214f
MD5 7a32f0eee0f155bcad7711861fd8226f
BLAKE2b-256 d6fbf1f4c7d2073e2dde96b4553ec3744a6af5a3dae70402517a24fcf75a2623

See more details on using hashes here.

Provenance

File details

Details for the file pyspnego-0.6.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pyspnego-0.6.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 235.7 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyspnego-0.6.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 4e967f29c099c196cbf4622587cd27e8c61f20adf78b1d3007b72596e60c9f23
MD5 c4588d7c3d767914c7c3b9103e0bfae9
BLAKE2b-256 f455df5c708d6965d594f9edafa0e9ada2c7169d47e4c693eaa80cff0dfbdcc7

See more details on using hashes here.

Provenance

File details

Details for the file pyspnego-0.6.0-cp37-cp37m-win32.whl.

File metadata

  • Download URL: pyspnego-0.6.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 218.9 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyspnego-0.6.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 838f875ee55004a274f6470460e62b7713237ae8b66a02680a2f31e43b3b5387
MD5 4a2f08bbd00978e44749f073f52a5450
BLAKE2b-256 8f8ec6348a617b5b9b7adb4596d05fcd1c0ba219a939edc5e7ac546b71c92567

See more details on using hashes here.

Provenance

Supported by

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