Skip to main content

Windows Negotiate Authentication Client and Server

Project description

Python SPNEGO Library

Build Status codecov PyPI version

Library to handle SPNEGO (Negotiate, NTLM, Kerberos) 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 - Python 2
apt-get install gcc python-dev libkrb5-dev

# Debian/Ubuntu - Python 3
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 imlpementation.

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.1.3.tar.gz (94.4 kB view hashes)

Uploaded Source

Built Distributions

pyspnego-0.1.3-py2.py3-none-any.whl (107.3 kB view hashes)

Uploaded Python 2 Python 3

pyspnego-0.1.3-cp39-cp39-win_amd64.whl (347.2 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

pyspnego-0.1.3-cp39-cp39-win32.whl (328.0 kB view hashes)

Uploaded CPython 3.9 Windows x86

pyspnego-0.1.3-cp38-cp38-win_amd64.whl (347.9 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

pyspnego-0.1.3-cp38-cp38-win32.whl (329.0 kB view hashes)

Uploaded CPython 3.8 Windows x86

pyspnego-0.1.3-cp37-cp37m-win_amd64.whl (344.5 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

pyspnego-0.1.3-cp37-cp37m-win32.whl (325.2 kB view hashes)

Uploaded CPython 3.7m Windows x86

pyspnego-0.1.3-cp36-cp36m-win_amd64.whl (344.6 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

pyspnego-0.1.3-cp36-cp36m-win32.whl (325.3 kB view hashes)

Uploaded CPython 3.6m Windows x86

pyspnego-0.1.3-cp35-cp35m-win_amd64.whl (342.8 kB view hashes)

Uploaded CPython 3.5m Windows x86-64

pyspnego-0.1.3-cp35-cp35m-win32.whl (323.8 kB view hashes)

Uploaded CPython 3.5m Windows x86

pyspnego-0.1.3-cp27-cp27m-win_amd64.whl (332.7 kB view hashes)

Uploaded CPython 2.7m Windows x86-64

pyspnego-0.1.3-cp27-cp27m-win32.whl (317.9 kB view hashes)

Uploaded CPython 2.7m Windows x86

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