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

Uploaded Source

Built Distributions

pyspnego-0.6.2-py3-none-any.whl (124.8 kB view details)

Uploaded Python 3

pyspnego-0.6.2-cp311-cp311-win_amd64.whl (233.1 kB view details)

Uploaded CPython 3.11 Windows x86-64

pyspnego-0.6.2-cp311-cp311-win32.whl (218.0 kB view details)

Uploaded CPython 3.11 Windows x86

pyspnego-0.6.2-cp310-cp310-win_amd64.whl (235.1 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyspnego-0.6.2-cp310-cp310-win32.whl (219.3 kB view details)

Uploaded CPython 3.10 Windows x86

pyspnego-0.6.2-cp39-cp39-win_amd64.whl (237.6 kB view details)

Uploaded CPython 3.9 Windows x86-64

pyspnego-0.6.2-cp39-cp39-win32.whl (221.3 kB view details)

Uploaded CPython 3.9 Windows x86

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

Uploaded CPython 3.8 Windows x86-64

pyspnego-0.6.2-cp38-cp38-win32.whl (221.8 kB view details)

Uploaded CPython 3.8 Windows x86

pyspnego-0.6.2-cp37-cp37m-win_amd64.whl (235.8 kB view details)

Uploaded CPython 3.7m Windows x86-64

pyspnego-0.6.2-cp37-cp37m-win32.whl (219.0 kB view details)

Uploaded CPython 3.7m Windows x86

File details

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

File metadata

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

File hashes

Hashes for pyspnego-0.6.2.tar.gz
Algorithm Hash digest
SHA256 e0ceeb2a1202b646b1586aa9e1cc528e03325644745c37ff836cb5d7774e008f
MD5 b389f58b61487c98f165be4590fd2745
BLAKE2b-256 f06b823c4363e2c24d8b57c3ab24680b62186f567fc40ec007723f6793257459

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for pyspnego-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 793e10684ffff45a22a21568c3c183a600c622ccd644740776d3e4e757bc1f01
MD5 f3958bec7cfce3a861c24cc0ccd2ca21
BLAKE2b-256 b089d0e77acf46801bce5ba8e24b012856761080e1c2b06d49f5a3addc5893ab

See more details on using hashes here.

Provenance

File details

Details for the file pyspnego-0.6.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyspnego-0.6.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 233.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for pyspnego-0.6.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bd5af387ef4f2b290c051e5f5ec792f0db04de4379f87cc71938070f8c48bf31
MD5 0c97069b1a35b77df8df4925d2bdbc92
BLAKE2b-256 88e92ad58f1bc6f06d6507459fab69a4f64fde0dc5df77e70cc03c0d2fda51e6

See more details on using hashes here.

Provenance

File details

Details for the file pyspnego-0.6.2-cp311-cp311-win32.whl.

File metadata

  • Download URL: pyspnego-0.6.2-cp311-cp311-win32.whl
  • Upload date:
  • Size: 218.0 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for pyspnego-0.6.2-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 a99e48b00368b851542caa44bfb60a096c9e714dce6f2d29148f05f0a6f393a1
MD5 d6c39d6783a21499e41a87169512bf15
BLAKE2b-256 7d9815e45ff7632d6b2c57a10752519e52317558c321abad93a373ba468534dd

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for pyspnego-0.6.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 999fd81c6960ef364ea8c6a675666cc4e669a5e9242d2d4a5d9d3103198ba36f
MD5 aa90648725427a771642f51e342c786a
BLAKE2b-256 1666c6eaea150f547ca10c380d684a8d3105df472df5b542d47907c1e707876e

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for pyspnego-0.6.2-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 481e23ebd23ab2a8a0254c262f73eb640f3989128036bd19b49c4bc1e071d3e3
MD5 dd69ca273de560e6986657bfd757887d
BLAKE2b-256 abec6bb7b04c60cbf16789dbfd37fcedbde663da245a605d1d27a7a0d00b5ae0

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for pyspnego-0.6.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 edda47fd2e54899da02fe3d2e517bc836168ce5a99244eb4884b9a6193deb577
MD5 d15def05231f54185ee8d2fda8f0aee6
BLAKE2b-256 fdf2aa576ab16c0c65ae65d369c5e8361e077865af6e530d32a357d7b130358a

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for pyspnego-0.6.2-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 0fa2702a3931dbb227f6f6db4948e7039198740e9a3042d257ea4779774ce5fe
MD5 31a4d711009bb3cdb83d1175b1bf8632
BLAKE2b-256 37753285548a76679a0fdc0cb97b8f5eef50e88358de877420109918c0d28bd1

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyspnego-0.6.2-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.15

File hashes

Hashes for pyspnego-0.6.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e46d906c8626fde24fa2b857ce5f6aaaa3c2dbebe11ff20e5da2d0fed04e565f
MD5 3de21e5032c1c877ad1951a9f75b09d1
BLAKE2b-256 42016a3017485f18f42fb183e7596f6304c13fbdc26021afc1af1a013bb987f2

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for pyspnego-0.6.2-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 ea514a3e6e303876d53523fb1ac09bc9d1bdb88cbbddbf4f9eea6e0c95a9d560
MD5 28d1f534f693d2900904beeb4a409405
BLAKE2b-256 7b9123bd44d4b05a57bbc62efa350f912a34e5e3cde104bd44fe6286855fc90f

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for pyspnego-0.6.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 41c798537f60eebc424ead3f8a55794196475b524cb1f05b5e309207b60244df
MD5 c16f7302951fadc2fda4738346b3ad5f
BLAKE2b-256 5278d86837898231cfb20e23a4cb329e330ddd4db78c1a75acc2c9963b35f610

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for pyspnego-0.6.2-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 695465d73cbe15abc0a719e6b6a99e9b17c17330949f2618bfa5f973bc0a2ce2
MD5 686980bf1ae8ec53d7bc6b5b78c1f154
BLAKE2b-256 bbb64047a16fc84a12d3f670cd085d04fa9f5f52d724a4d80551451a9534b1e7

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