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

Uploaded Source

Built Distributions

pyspnego-0.3.0-py2.py3-none-any.whl (110.6 kB view details)

Uploaded Python 2 Python 3

pyspnego-0.3.0-cp310-cp310-win_amd64.whl (198.8 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyspnego-0.3.0-cp310-cp310-win32.whl (184.2 kB view details)

Uploaded CPython 3.10 Windows x86

pyspnego-0.3.0-cp39-cp39-win_amd64.whl (198.3 kB view details)

Uploaded CPython 3.9 Windows x86-64

pyspnego-0.3.0-cp39-cp39-win32.whl (184.0 kB view details)

Uploaded CPython 3.9 Windows x86

pyspnego-0.3.0-cp38-cp38-win_amd64.whl (198.9 kB view details)

Uploaded CPython 3.8 Windows x86-64

pyspnego-0.3.0-cp38-cp38-win32.whl (184.8 kB view details)

Uploaded CPython 3.8 Windows x86

pyspnego-0.3.0-cp37-cp37m-win_amd64.whl (196.7 kB view details)

Uploaded CPython 3.7m Windows x86-64

pyspnego-0.3.0-cp37-cp37m-win32.whl (182.3 kB view details)

Uploaded CPython 3.7m Windows x86

pyspnego-0.3.0-cp36-cp36m-win_amd64.whl (197.0 kB view details)

Uploaded CPython 3.6m Windows x86-64

pyspnego-0.3.0-cp36-cp36m-win32.whl (182.5 kB view details)

Uploaded CPython 3.6m Windows x86

File details

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

File metadata

  • Download URL: pyspnego-0.3.0.tar.gz
  • Upload date:
  • Size: 308.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyspnego-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9b0c7523958a289b493721fa5e198473ebcb9a1bbc3fd21fa121cb1e34b09607
MD5 959223cbe134cecb2c8f2e0f20d59b09
BLAKE2b-256 90139a387e11f31e14ff137e50dcaef30fb8a99d4c20a6b47181fb76f64065c7

See more details on using hashes here.

Provenance

File details

Details for the file pyspnego-0.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pyspnego-0.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 110.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyspnego-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7ef3aa16e425bfd12f5454836f6a7723207460cfc0bb6bef572ba14ea8c369bd
MD5 050e5b0f34ddecf52b7dcd0f27c5944a
BLAKE2b-256 020badb1b8d75ec50c30308aa753a4d1a5f4d03951763153d72c8e27f821370e

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.3.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 198.8 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyspnego-0.3.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 dd644a68ac350762162ddb33f09626e3f3bb270fb8beb3606484d5adb6e34419
MD5 2bd1eccbc6a758296dd7a62a1ef9b051
BLAKE2b-256 9ba00634a2a5c0bd144a344ecd4313de7ef422ea3d5c3ae63679cb6625128268

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.3.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 184.2 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyspnego-0.3.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 826a844179e96b8896571eefa99a85003acf9305aec2262bf71e8958567559de
MD5 ec00d7411aafe35b8d4493f311f9344c
BLAKE2b-256 672ca9f4103c45175fbd1bf8b076224f1f99a48b36afaa13d2c91d65b6c0caf9

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.3.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 198.3 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyspnego-0.3.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a744136fea7ef38dc8cbfd856883961de30d3e210f873dfb6eafe70742e1c439
MD5 cea2cd48c04fbbc42e667868a0d34e7f
BLAKE2b-256 a946f4f515ee7d24744d3e4bfd89d05707282b17d541543115b86bfccea1bca5

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.3.0-cp39-cp39-win32.whl
  • Upload date:
  • Size: 184.0 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyspnego-0.3.0-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 850256fa04454debb3a1b9a7dcd143004db762a10b2fa4f27c3fd6666d07d88c
MD5 2ef04597bcde0f8f06db90c2bc4f8603
BLAKE2b-256 b79f2081acf184d2620afab917948d25db1cac19b7490381e249c1bd218e2c6b

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.3.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 198.9 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyspnego-0.3.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 f66fb14d38fde1ed65e7dfbfd3374c58b3f475245e5754124a5ebbdcce372de4
MD5 ef5a9936f82d0fdb4230b0cae6fff6ce
BLAKE2b-256 64a091329f41f34b9ba99142d2fd7741784eccb9e810d3c4693968db27b5bf5d

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.3.0-cp38-cp38-win32.whl
  • Upload date:
  • Size: 184.8 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyspnego-0.3.0-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 5d72f21488c2d15ea72bf5b0d08dcc58fda32f91caa035be61347a6f06fa4bef
MD5 0a3daf74be0db6008769f09ac2fcff35
BLAKE2b-256 66bc4b14efdcfe9552b1f834bf45f3e4ead28de21275f1cf7029248d5932e3df

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.3.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 196.7 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyspnego-0.3.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 95f6dd0543deb53343129c068b24b955f29d7a33b4e784b6ff486180ed792625
MD5 bc27841a345ee595f2a65efd28de01ba
BLAKE2b-256 5ce272102938b8e72847697f4be3821eb97a28d9be4e05045b6e84325ce378d0

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.3.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 182.3 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyspnego-0.3.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 399ae44d0c9dd7c410b8bb5b36167c287f4a1545e40de13fda350622f56230d7
MD5 e067e1b5a84e6ad5c12eb9120e9afd3f
BLAKE2b-256 990239fb0f86c429ec01d3c1fb6536c5da9a9d48b46271ed41f2c7c7b0904ba2

See more details on using hashes here.

Provenance

File details

Details for the file pyspnego-0.3.0-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: pyspnego-0.3.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 197.0 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyspnego-0.3.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 e69753f3ca798f61f71aef44a5630f18718ea0caf2c430e6a5e01e7307448cad
MD5 de33cd81015d637c435cf01837839802
BLAKE2b-256 c53ae4fe24beb247a4ab7f93188113df3b727106e22c3bc405e73011ab2b5f5f

See more details on using hashes here.

Provenance

File details

Details for the file pyspnego-0.3.0-cp36-cp36m-win32.whl.

File metadata

  • Download URL: pyspnego-0.3.0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 182.5 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for pyspnego-0.3.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 17f3ba4255d3ab177083a13b39cfa5f76a0c770a7f276d82f0ea06ccc8e9eaad
MD5 05cc4c981948c1b4e7e829da44691780
BLAKE2b-256 5311823a53b1367ada3a2d33950d837d530dde3235c5c39e7f9e1d5d6e4a8e8a

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