pyspnego


Namepyspnego JSON
Version 0.1.6 PyPI version JSON
download
home_pagehttps://github.com/jborean93/pyspnego
SummaryWindows Negotiate Authentication Client and Server
upload_time2021-05-07 04:48:27
maintainer
docs_urlNone
authorJordan Borean
requires_python>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*
licenseMIT
keywords windows spnego negotiate ntlm kerberos sspi gssapi auth
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Python SPNEGO Library

[![Build Status](https://dev.azure.com/jborean93/jborean93/_apis/build/status/jborean93.pyspnego?branchName=main)](https://dev.azure.com/jborean93/jborean93/_build/latest?definitionId=2&branchName=main)
[![codecov](https://codecov.io/gh/jborean93/pyspnego/branch/main/graph/badge.svg)](https://codecov.io/gh/jborean93/pyspnego)
[![PyPI version](https://badge.fury.io/py/pyspnego.svg)](https://badge.fury.io/py/pyspnego)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jborean93/pyspnego/blob/master/LICENSE)

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](#how-to-install) for more details

* CPython 2.7, 3.5+
* [cryptography](https://github.com/pyca/cryptography)

### Optional Requirements

The following Python libraries can be installed to add extra features that do not come with the base package:

* [python-gssapi](https://github.com/pythongssapi/python-gssapi) for Kerberos authentication on Linux
* [ruamel.yaml](https://pypi.org/project/ruamel.yaml/) for YAML output support on `pyspnego-parse`


## How to Install

To install pyspnego with all basic features, run

```bash
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

```bash
# 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

```bash
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](https://github.com/gssapi/gss-ntlmssp) library for full Negotiate support. This can be done with

```bash
# 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](docs/examples) 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._


## Backlog

* Add support for anonymous authentication
* See if `pywinrm` wants to use this



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jborean93/pyspnego",
    "name": "pyspnego",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*",
    "maintainer_email": "",
    "keywords": "windows spnego negotiate ntlm kerberos sspi gssapi auth",
    "author": "Jordan Borean",
    "author_email": "jborean93@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/31/67/1e34ece99b804bd26b0043d584ffb5bc789e34001ac1612eeb073b5c283f/pyspnego-0.1.6.tar.gz",
    "platform": "",
    "description": "# Python SPNEGO Library\r\n\r\n[![Build Status](https://dev.azure.com/jborean93/jborean93/_apis/build/status/jborean93.pyspnego?branchName=main)](https://dev.azure.com/jborean93/jborean93/_build/latest?definitionId=2&branchName=main)\r\n[![codecov](https://codecov.io/gh/jborean93/pyspnego/branch/main/graph/badge.svg)](https://codecov.io/gh/jborean93/pyspnego)\r\n[![PyPI version](https://badge.fury.io/py/pyspnego.svg)](https://badge.fury.io/py/pyspnego)\r\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jborean93/pyspnego/blob/master/LICENSE)\r\n\r\nLibrary to handle SPNEGO (Negotiate, NTLM, Kerberos) authentication. Also includes a packet parser that can be used to\r\ndecode raw NTLM/SPNEGO/Kerberos tokens into a human readable format.\r\n\r\n\r\n## Requirements\r\n\r\nSee [How to Install](#how-to-install) for more details\r\n\r\n* CPython 2.7, 3.5+\r\n* [cryptography](https://github.com/pyca/cryptography)\r\n\r\n### Optional Requirements\r\n\r\nThe following Python libraries can be installed to add extra features that do not come with the base package:\r\n\r\n* [python-gssapi](https://github.com/pythongssapi/python-gssapi) for Kerberos authentication on Linux\r\n* [ruamel.yaml](https://pypi.org/project/ruamel.yaml/) for YAML output support on `pyspnego-parse`\r\n\r\n\r\n## How to Install\r\n\r\nTo install pyspnego with all basic features, run\r\n\r\n```bash\r\npip install pyspnego\r\n```\r\n\r\n### Kerberos Authentication\r\n\r\nWhile pyspnego supports Kerberos authentication on Linux, it isn't included by default due to its reliance on system\r\npackages to be present.\r\n\r\nTo install these packages, run the below\r\n\r\n```bash\r\n# Debian/Ubuntu - Python 2\r\napt-get install gcc python-dev libkrb5-dev\r\n\r\n# Debian/Ubuntu - Python 3\r\napt-get install gcc python3-dev libkrb5-dev\r\n\r\n# Centos/RHEL\r\nyum install gcc python-devel krb5-devel\r\n\r\n# Fedora\r\ndnf install gcc python-devel krb5-devel\r\n\r\n# Arch Linux\r\npacman -S gcc krb5\r\n```\r\n\r\nOnce installed you can install the Python packages with\r\n\r\n```bash\r\npip install pyspnego[kerberos]\r\n```\r\n\r\nKerberos also needs to be configured to talk to the domain but that is outside the scope of this page.\r\n\r\nWhile NTLM auth works out of the box, it is recommended to install the\r\n[gss-ntlmssp](https://github.com/gssapi/gss-ntlmssp) library for full Negotiate support. This can be done with\r\n\r\n```bash\r\n# Debian/Ubuntu\r\napt-get install gss-ntlmssp\r\n\r\n# Centos/RHEL\r\nyum install gssntlmssp\r\n\r\n# Fedora\r\ndnf install gssntlmssp\r\n\r\n# Arch Linux\r\n# AUR package https://aur.archlinux.org/packages/gss-ntlmssp/\r\n```\r\n\r\n\r\n## How to Use\r\n\r\nSee [the examples section](docs/examples) for examples on how to use the authentication side of the library.\r\n\r\n_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._\r\n\r\n\r\n## Backlog\r\n\r\n* Add support for anonymous authentication\r\n* See if `pywinrm` wants to use this\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Windows Negotiate Authentication Client and Server",
    "version": "0.1.6",
    "split_keywords": [
        "windows",
        "spnego",
        "negotiate",
        "ntlm",
        "kerberos",
        "sspi",
        "gssapi",
        "auth"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "4b438de13089c4e62a8b79e2d07e3c98",
                "sha256": "f90a41f7d31e049f3a2e566f02ce06d86f13bbd2e3796b3af3bdb2be75c6e836"
            },
            "downloads": -1,
            "filename": "pyspnego-0.1.6-cp27-cp27m-win32.whl",
            "has_sig": false,
            "md5_digest": "4b438de13089c4e62a8b79e2d07e3c98",
            "packagetype": "bdist_wheel",
            "python_version": "cp27",
            "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*",
            "size": 318646,
            "upload_time": "2021-05-07T04:48:00",
            "upload_time_iso_8601": "2021-05-07T04:48:00.643237Z",
            "url": "https://files.pythonhosted.org/packages/ce/ac/f3c8c9b796feb13bd5c9b6453e79af5212d9fa6690ea6f972ba5e53dfe4c/pyspnego-0.1.6-cp27-cp27m-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "a5d6abceff349fbd203e716b37d3f21b",
                "sha256": "44469f7cf2a9435d7115c557db4df6bd6a74ce0056511b88b672b58ff2d477f7"
            },
            "downloads": -1,
            "filename": "pyspnego-0.1.6-cp27-cp27m-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "a5d6abceff349fbd203e716b37d3f21b",
            "packagetype": "bdist_wheel",
            "python_version": "cp27",
            "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*",
            "size": 333504,
            "upload_time": "2021-05-07T04:48:03",
            "upload_time_iso_8601": "2021-05-07T04:48:03.586782Z",
            "url": "https://files.pythonhosted.org/packages/8a/62/4fcca498099892d361a998050fcc6d9b64560b177bd93ff10b14f04c91c3/pyspnego-0.1.6-cp27-cp27m-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "4a0ad0e3865b7d044b42322637d5d13c",
                "sha256": "c05aa1efcb9b0cf3c6341c48a6b349c3b669b0d7d99ab65a789c0c1071701136"
            },
            "downloads": -1,
            "filename": "pyspnego-0.1.6-cp35-cp35m-win32.whl",
            "has_sig": false,
            "md5_digest": "4a0ad0e3865b7d044b42322637d5d13c",
            "packagetype": "bdist_wheel",
            "python_version": "cp35",
            "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*",
            "size": 324355,
            "upload_time": "2021-05-07T04:48:05",
            "upload_time_iso_8601": "2021-05-07T04:48:05.670976Z",
            "url": "https://files.pythonhosted.org/packages/92/83/c05b8a71ad12747a7e293e1fe311821a1cfcb84ede04f0bf874f674f8d4c/pyspnego-0.1.6-cp35-cp35m-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "5ba900f17e1cb1b0229c8ac84dd83739",
                "sha256": "777c9524e91298b2ec3d728dbb85e44d047ddd857db6c2658d977401fedfcc9c"
            },
            "downloads": -1,
            "filename": "pyspnego-0.1.6-cp35-cp35m-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "5ba900f17e1cb1b0229c8ac84dd83739",
            "packagetype": "bdist_wheel",
            "python_version": "cp35",
            "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*",
            "size": 343441,
            "upload_time": "2021-05-07T04:48:07",
            "upload_time_iso_8601": "2021-05-07T04:48:07.786785Z",
            "url": "https://files.pythonhosted.org/packages/0c/c3/95c1331206ce5a1cf3b7483cbcadd0b3a699ad1bff3fd729731190f0899f/pyspnego-0.1.6-cp35-cp35m-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "34d79978e7644615b5fbafae27d4212d",
                "sha256": "507809d2e1fc8733a4f0801ee59d01db646b41d3ab8b90a6f3a16a17eef3fc37"
            },
            "downloads": -1,
            "filename": "pyspnego-0.1.6-cp36-cp36m-win32.whl",
            "has_sig": false,
            "md5_digest": "34d79978e7644615b5fbafae27d4212d",
            "packagetype": "bdist_wheel",
            "python_version": "cp36",
            "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*",
            "size": 325972,
            "upload_time": "2021-05-07T04:48:09",
            "upload_time_iso_8601": "2021-05-07T04:48:09.841905Z",
            "url": "https://files.pythonhosted.org/packages/5d/1c/b36e16988e8edb3a3225541de1632e362e3c860bc3e1d1e078b50b521999/pyspnego-0.1.6-cp36-cp36m-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "d868af44c7f2bdc041c4c4277d6a7210",
                "sha256": "e021472424fcb477d9a211437f6a14c2d9cb59e20eeee9ae7992bd7deee50064"
            },
            "downloads": -1,
            "filename": "pyspnego-0.1.6-cp36-cp36m-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "d868af44c7f2bdc041c4c4277d6a7210",
            "packagetype": "bdist_wheel",
            "python_version": "cp36",
            "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*",
            "size": 345430,
            "upload_time": "2021-05-07T04:48:11",
            "upload_time_iso_8601": "2021-05-07T04:48:11.806781Z",
            "url": "https://files.pythonhosted.org/packages/7f/0d/f182695de063ad3621e4e5cdb4ad028b981fa5478696d7ea0d0ea39673ff/pyspnego-0.1.6-cp36-cp36m-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "cd9398ac9ac2988dfa78bea188629c7d",
                "sha256": "0940e0bdec72c6266ef9604db929ddda86f1dafe2c804ac3d6e30161a53e414d"
            },
            "downloads": -1,
            "filename": "pyspnego-0.1.6-cp37-cp37m-win32.whl",
            "has_sig": false,
            "md5_digest": "cd9398ac9ac2988dfa78bea188629c7d",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*",
            "size": 325797,
            "upload_time": "2021-05-07T04:48:13",
            "upload_time_iso_8601": "2021-05-07T04:48:13.778784Z",
            "url": "https://files.pythonhosted.org/packages/a9/04/6a80d51025a77039222f38ff1c3883a67e710c99a95a5ac163f43f210fb0/pyspnego-0.1.6-cp37-cp37m-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "31fed2d8f43f5c1f8e2c6d5cdfb27460",
                "sha256": "d3e7d55447cc353765cef6d77b3c57fd02f77ddc83a4fb3b4b696df92f908ae1"
            },
            "downloads": -1,
            "filename": "pyspnego-0.1.6-cp37-cp37m-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "31fed2d8f43f5c1f8e2c6d5cdfb27460",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*",
            "size": 345203,
            "upload_time": "2021-05-07T04:48:15",
            "upload_time_iso_8601": "2021-05-07T04:48:15.991453Z",
            "url": "https://files.pythonhosted.org/packages/29/5d/d4493540550ccd2ed3f53f009faacaddc6d02bb2a31ba368931aceb19174/pyspnego-0.1.6-cp37-cp37m-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "4be1ccbf130be594db639203bf5df2df",
                "sha256": "ed4fece1a834cc29377f43f4ff459ae7eb7c7d937cfd3e4b46676fe9984c8c74"
            },
            "downloads": -1,
            "filename": "pyspnego-0.1.6-cp38-cp38-win32.whl",
            "has_sig": false,
            "md5_digest": "4be1ccbf130be594db639203bf5df2df",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*",
            "size": 329725,
            "upload_time": "2021-05-07T04:48:18",
            "upload_time_iso_8601": "2021-05-07T04:48:18.294781Z",
            "url": "https://files.pythonhosted.org/packages/ba/38/ae4e27692761ad670fa45d49af9f34935bf6e8d4d0cb585d7b7ad868fbaf/pyspnego-0.1.6-cp38-cp38-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "ad88a3b4ae29345d9b0ee476a7d71269",
                "sha256": "cc57132ebe7b6b5d14e940bf4069a1206ad0fe23f51281dee4e7979b34a369d3"
            },
            "downloads": -1,
            "filename": "pyspnego-0.1.6-cp38-cp38-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "ad88a3b4ae29345d9b0ee476a7d71269",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*",
            "size": 348641,
            "upload_time": "2021-05-07T04:48:20",
            "upload_time_iso_8601": "2021-05-07T04:48:20.578447Z",
            "url": "https://files.pythonhosted.org/packages/80/e1/1a9ae91511f28a7f60e7c1e62b023e7942a25b921da18c1891e350d5fc14/pyspnego-0.1.6-cp38-cp38-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "229f1755a11f926343d0664bce6816fc",
                "sha256": "83d52b9e8b55243fa3711d89e77d94935a60b8638e8659b572dee898d359bbe6"
            },
            "downloads": -1,
            "filename": "pyspnego-0.1.6-cp39-cp39-win32.whl",
            "has_sig": false,
            "md5_digest": "229f1755a11f926343d0664bce6816fc",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*",
            "size": 328790,
            "upload_time": "2021-05-07T04:48:22",
            "upload_time_iso_8601": "2021-05-07T04:48:22.626784Z",
            "url": "https://files.pythonhosted.org/packages/24/27/428769cd2080ef6965fdd2d4a5b8713bbf75841a2d0935c408a793421539/pyspnego-0.1.6-cp39-cp39-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "3e3d54cb517d0d47a955c68f322f2879",
                "sha256": "5701dd50597c0a11b4bd1d3921fd1c32ba3b7ec15c3e273c486870efe673dd52"
            },
            "downloads": -1,
            "filename": "pyspnego-0.1.6-cp39-cp39-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "3e3d54cb517d0d47a955c68f322f2879",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*",
            "size": 348043,
            "upload_time": "2021-05-07T04:48:24",
            "upload_time_iso_8601": "2021-05-07T04:48:24.316778Z",
            "url": "https://files.pythonhosted.org/packages/79/15/fac460763d2afa6234d144222342a0182ff9955fa98f79e5e4844e40652a/pyspnego-0.1.6-cp39-cp39-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "8f49bcc7c89e5f2d6316cfad42c12089",
                "sha256": "5be3fa80bc81a11b9254e3800aa350db06b2eb1b9d830f7770a1baadae415185"
            },
            "downloads": -1,
            "filename": "pyspnego-0.1.6-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8f49bcc7c89e5f2d6316cfad42c12089",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*",
            "size": 107650,
            "upload_time": "2021-05-07T04:48:26",
            "upload_time_iso_8601": "2021-05-07T04:48:26.030600Z",
            "url": "https://files.pythonhosted.org/packages/a2/17/ac83738eb7eb1cad20ba12d78b39f1b3fd886e2a21ee786f98785aaeb513/pyspnego-0.1.6-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "538c388b78fcc36c3d15914500b3f4c7",
                "sha256": "0356bccedc033b7266d89503eca50717f81fc9d3b98cb1dd5227bb7c1a9275ae"
            },
            "downloads": -1,
            "filename": "pyspnego-0.1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "538c388b78fcc36c3d15914500b3f4c7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*",
            "size": 94331,
            "upload_time": "2021-05-07T04:48:27",
            "upload_time_iso_8601": "2021-05-07T04:48:27.750785Z",
            "url": "https://files.pythonhosted.org/packages/31/67/1e34ece99b804bd26b0043d584ffb5bc789e34001ac1612eeb073b5c283f/pyspnego-0.1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-05-07 04:48:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "jborean93",
    "error": "Could not fetch GitHub repository",
    "lcname": "pyspnego"
}
        
Elapsed time: 0.24029s