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

Uploaded Source

Built Distributions

pyspnego-0.4.0-py2.py3-none-any.whl (121.7 kB view details)

Uploaded Python 2 Python 3

pyspnego-0.4.0-cp310-cp310-win_amd64.whl (198.5 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyspnego-0.4.0-cp310-cp310-win32.whl (188.5 kB view details)

Uploaded CPython 3.10 Windows x86

pyspnego-0.4.0-cp39-cp39-win_amd64.whl (198.4 kB view details)

Uploaded CPython 3.9 Windows x86-64

pyspnego-0.4.0-cp39-cp39-win32.whl (188.4 kB view details)

Uploaded CPython 3.9 Windows x86

pyspnego-0.4.0-cp38-cp38-win_amd64.whl (198.8 kB view details)

Uploaded CPython 3.8 Windows x86-64

pyspnego-0.4.0-cp38-cp38-win32.whl (189.0 kB view details)

Uploaded CPython 3.8 Windows x86

pyspnego-0.4.0-cp37-cp37m-win_amd64.whl (197.1 kB view details)

Uploaded CPython 3.7m Windows x86-64

pyspnego-0.4.0-cp37-cp37m-win32.whl (187.2 kB view details)

Uploaded CPython 3.7m Windows x86

pyspnego-0.4.0-cp36-cp36m-win_amd64.whl (207.8 kB view details)

Uploaded CPython 3.6m Windows x86-64

pyspnego-0.4.0-cp36-cp36m-win32.whl (193.4 kB view details)

Uploaded CPython 3.6m Windows x86

File details

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

File metadata

  • Download URL: pyspnego-0.4.0.tar.gz
  • Upload date:
  • Size: 324.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyspnego-0.4.0.tar.gz
Algorithm Hash digest
SHA256 4f82abd01a24979cfca1980bd24948dddb07a05b283a65af10e62051ef62c7dd
MD5 ae3d61d1bf84f0f21830e15ec420cef6
BLAKE2b-256 ef23b25e8ac1f75f3b9f99eac0e95167b95b5a83835b73ea2d96f31144c4de9e

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.4.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 121.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyspnego-0.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2a461012fba2681d7acca50ae080566907c1fbcc8435f36eacca57c0e252fee8
MD5 2b4f7d1ba775817a3887b2876d9165e8
BLAKE2b-256 dc2ea6485726d88adac1ac220b15e66a080119983a38e4b35b257c70ee28deb1

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.4.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 198.5 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyspnego-0.4.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 89905e90fb436ff5979827918a9f92425d4b7bec0d081aca573ec421786be006
MD5 13558396ad9a0dd9bded098555ce5790
BLAKE2b-256 a8af86751972b0dee8e7c7a43a42db2a6e792e8c67274a103997bc05f41ec2b5

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.4.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 188.5 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyspnego-0.4.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 f6a96d270d5008580e8b5bd14f966660a1de9fe2600a55f14feba6534a4c435d
MD5 34fbc72a9771c5d92277331735eb944e
BLAKE2b-256 b84d9b4366c9d9a04c07336e37935991ea04a2900f0f852691d2223340a87e09

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.4.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 198.4 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyspnego-0.4.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c6e9c571489263fc7f995c1479960d8db71aef9f793919c282c1d3fc7416ad08
MD5 39fdaa89f7d02f67bae5f5740f49d393
BLAKE2b-256 162cfbc00b1091bb8518ee21b1be6ecab6dac0134a5836eeb9a74ea64568a2b7

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.4.0-cp39-cp39-win32.whl
  • Upload date:
  • Size: 188.4 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyspnego-0.4.0-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 0516647486976ab152de64ea314cfb3e22ac7a8702a25aaf42f2f6385c6947ba
MD5 1fdd42815f255904222b0a16027c7241
BLAKE2b-256 68cac09cfc07c6b63a53e005bcab83bfcf5f5cba9180541a764d09b275bb6dd8

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.4.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 198.8 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyspnego-0.4.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 57984d673737a41a42acce03f392b40d8fc523c898512beefefd61a305501892
MD5 cb0e5233a45406bda1253cbd968e6057
BLAKE2b-256 5fdc8b6b50d9a45dc8b23250550e4352175805ff393ad970b9a26d7bc144c022

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.4.0-cp38-cp38-win32.whl
  • Upload date:
  • Size: 189.0 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyspnego-0.4.0-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 3b84f27aa43df45dcbad10b64f175de4d9c487c7d55aa85e4bebcc1700009f4c
MD5 b445151023cceddadd0711ef5e0efb81
BLAKE2b-256 6df557c1fce6143585caa657af70e37b0fbb2ac60ccedb08589667276ca81653

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.4.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 197.1 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyspnego-0.4.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 37145548b1bd5dee54947737b133fed6826092920ee6465f35c911a01eb5aaa7
MD5 0a35966988c3ffce8d62480de74562e0
BLAKE2b-256 17901322e93866ccfe80871c75244c33917a43890f7c96ffe6e62730d6e43e8d

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.4.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 187.2 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyspnego-0.4.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 e7ae585feb22a42f643ba5d7426c5f235c12daced9c996607dbe094a835526ba
MD5 9a3c297dfeb6dc603d5a6b4a1de0e7d2
BLAKE2b-256 7799b75e17dd118a2f04a5db91d44de1cc5d0bf3777ed15ae303b53a78ce4bf1

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.4.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 207.8 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyspnego-0.4.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 b714f1a89c0f34572a8b30286e55f7c6332c135800d1a00188d319cb871bc398
MD5 b7e0846638af9ea6c96c18ee63f7ff01
BLAKE2b-256 d84eea3bbe61ec5d63e530a2be9ac86889614faec8e46609b781dc20bc08dee9

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.4.0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 193.4 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pyspnego-0.4.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 1c4710d95665e6501eaf60e78e243f0052bcba3692a8fc287b1fadcae7e674d9
MD5 2945493ee438f5490cfb7ea9387716d7
BLAKE2b-256 040938359ea19bab8db1080336faa471ada7ff58c53338423c62c5d59fe11092

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