Skip to main content

High level interface to SSPI for Kerberos client auth

Project description

Info:

See github for the latest source.

Author:

Bernie Hackett <bernie@mongodb.com>

About

A native Kerberos SSPI client implementation. This module mimics the API of pykerberos to implement Kerberos SSPI authentication on Microsoft Windows. It supports Python 2.6, 2.7, and 3.3+.

Installation

WinKerberos is in the Python Package Index (pypi). Use pip to install it:

python -m pip install winkerberos

Building and installing from source

You must have the correct version of VC++ installed for your version of Python:

  • Python 2.6 - Visual Studio 2008 (Professional for 64bit)

  • Python 2.7 - Visual Studio 2008 (Professional for 64bit)

  • Python 3.3 - Visual Studio 2010 (Professional for 64bit)

  • Python 3.4 - Visual Studio 2010 (Professional for 64bit)

  • Python 3.5+ - Visual Studio 2015 (Any version)

The Microsoft Visual C++ Compiler for Python 2.7 could also be used to build for Python 2.6 and 2.7.

Once you have the required compiler installed, run the following command from the root directory of the WinKerberos source:

python setup.py install

Building HTML documentation

First install Sphinx:

python -m pip install Sphinx

Then run the following command from the root directory of the WinKerberos source:

python setup.py doc

Examples

This is a simplified example of a complete authentication session following RFC-4752, section 3.1:

import winkerberos as kerberos

def send_response_and_receive_challenge(response):
    # Your server communication code here...
    pass

def authenticate_kerberos(service, user):
    # Initialize the context object with a service principal.
    status, ctx = kerberos.authGSSClientInit(service)

    # GSSAPI is a "client goes first" SASL mechanism. Send the
    # first "response" to the server and recieve its first
    # challenge.
    status = kerberos.authGSSClientStep(ctx, "")
    response = kerberos.authGSSClientResponse(ctx)
    challenge = send_response_and_receive_challenge(response)

    # Keep processing challenges and sending responses until
    # authGSSClientStep reports AUTH_GSS_COMPLETE.
    while status == kerberos.AUTH_GSS_CONTINUE:
        status = kerberos.authGSSClientStep(ctx, challenge)
        response = kerberos.authGSSClientResponse(ctx) or ''
        challenge = send_response_and_receive_challenge(response)

    # Decrypt the server's last challenge
    kerberos.authGSSClientUnwrap(ctx, challenge)
    data = kerberos.authGSSClientResponse(ctx)
    # Encrypt a response including the user principal to authorize.
    kerberos.authGSSClientWrap(ctx, data, user)
    response = kerberos.authGSSClientResponse(ctx)

    # Complete authentication.
    send_response_and_receive_challenge(response)

Viewing API Documentation without Sphinx

Use the help function in the python interactive shell:

>>> import winkerberos
>>> help(winkerberos)

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

winkerberos-0.5.0.zip (37.6 kB view details)

Uploaded Source

Built Distributions

winkerberos-0.5.0-cp36-cp36m-win_amd64.whl (18.0 kB view details)

Uploaded CPython 3.6m Windows x86-64

winkerberos-0.5.0-cp36-cp36m-win32.whl (15.9 kB view details)

Uploaded CPython 3.6m Windows x86

winkerberos-0.5.0-cp35-cp35m-win_amd64.whl (18.0 kB view details)

Uploaded CPython 3.5m Windows x86-64

winkerberos-0.5.0-cp35-cp35m-win32.whl (15.9 kB view details)

Uploaded CPython 3.5m Windows x86

winkerberos-0.5.0-cp34-cp34m-win_amd64.whl (15.6 kB view details)

Uploaded CPython 3.4m Windows x86-64

winkerberos-0.5.0-cp34-cp34m-win32.whl (14.4 kB view details)

Uploaded CPython 3.4m Windows x86

winkerberos-0.5.0-cp33-cp33m-win_amd64.whl (15.6 kB view details)

Uploaded CPython 3.3m Windows x86-64

winkerberos-0.5.0-cp33-cp33m-win32.whl (14.4 kB view details)

Uploaded CPython 3.3m Windows x86

winkerberos-0.5.0-cp27-cp27m-win_amd64.whl (16.2 kB view details)

Uploaded CPython 2.7m Windows x86-64

winkerberos-0.5.0-cp27-cp27m-win32.whl (14.6 kB view details)

Uploaded CPython 2.7m Windows x86

winkerberos-0.5.0-cp26-cp26m-win_amd64.whl (16.5 kB view details)

Uploaded CPython 2.6m Windows x86-64

winkerberos-0.5.0-cp26-cp26m-win32.whl (14.9 kB view details)

Uploaded CPython 2.6m Windows x86

File details

Details for the file winkerberos-0.5.0.zip.

File metadata

  • Download URL: winkerberos-0.5.0.zip
  • Upload date:
  • Size: 37.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for winkerberos-0.5.0.zip
Algorithm Hash digest
SHA256 a2143ea0a47ba58bb3cedf9d7107c016adaa0a7ed933fc683c5f078383b34645
MD5 2c0c4bbd5159d240dc1dc4e4b16af632
BLAKE2b-256 ac6b85f0896c72b55c3f394ea630e9e2242c41899587ad8aab45e23974a2e890

See more details on using hashes here.

File details

Details for the file winkerberos-0.5.0-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for winkerberos-0.5.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 84127716bb169b37862b082ff95d992d3f876f85082e471fc7a474a8770429b4
MD5 3ddf69d9fe7241d6f9d6f94cb3917086
BLAKE2b-256 289126a7eed3b7e0dea9db3e28adc3ebab99e9ae39e4b58713cf5c23a02fa376

See more details on using hashes here.

File details

Details for the file winkerberos-0.5.0-cp36-cp36m-win32.whl.

File metadata

File hashes

Hashes for winkerberos-0.5.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 67f4b053e867767cbf57d2ea81da6faf16bcedf692014bcde498915b283c19b6
MD5 24380520830e7b14c89edd8ccfaff187
BLAKE2b-256 f7d0d781b14dee06bc1130a2d83908adc75e6af6c8399534815d6cedd2277468

See more details on using hashes here.

File details

Details for the file winkerberos-0.5.0-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for winkerberos-0.5.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 54ac5b19e29f5377d03197235b23433ca706b74cc025d8ef2b16377e7ef6f0ff
MD5 3ac0f3b1393c751b1e6151f110d37ec8
BLAKE2b-256 d8e9847cf6a1738a72a04865ea5236bcf278bea9bd1dff096d8457c5ca0b353f

See more details on using hashes here.

File details

Details for the file winkerberos-0.5.0-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for winkerberos-0.5.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 443b7f1b9f594756eca9b6e8f9f912db96ce89632eb097309b71747cb1cae83a
MD5 49fe920071ba5c1f5848d3e840df3b88
BLAKE2b-256 aca0d055ddacebca92fa541fa0750a47d25edc67149f3b0c0e6c9919093662fe

See more details on using hashes here.

File details

Details for the file winkerberos-0.5.0-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for winkerberos-0.5.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 5f46adb9771bd5de3c6872f5f30d1b49922612bc2cf87c6f4f57738c5c0ec0f3
MD5 f5de656383e40857ef69cc4a5386ecd0
BLAKE2b-256 27285309fb15c5df2e57b824dcc61428deb799dee9ebd61fcf8b0eb4f3497c2d

See more details on using hashes here.

File details

Details for the file winkerberos-0.5.0-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for winkerberos-0.5.0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 fd772fc0368b50b96270ee1fdf6d209e2854b1850ecfd5a708c0b4b9f64f599a
MD5 c66256970127f5170278c199a7840d24
BLAKE2b-256 9c7863c2082f78d4ba32134ee59df8cdc68904b7c21fc9f46d46b54ce261c5ba

See more details on using hashes here.

File details

Details for the file winkerberos-0.5.0-cp33-cp33m-win_amd64.whl.

File metadata

File hashes

Hashes for winkerberos-0.5.0-cp33-cp33m-win_amd64.whl
Algorithm Hash digest
SHA256 69c99459d9227536db6f60e3c8c2c72a31225eb41b3858f0c487f5349d988c7a
MD5 673b77e5291f2867ae34796612094b1a
BLAKE2b-256 2a977f657ba7f6ca6d39b3a471301a027ac928f41cfc8f510c584fdd2d838092

See more details on using hashes here.

File details

Details for the file winkerberos-0.5.0-cp33-cp33m-win32.whl.

File metadata

File hashes

Hashes for winkerberos-0.5.0-cp33-cp33m-win32.whl
Algorithm Hash digest
SHA256 b55f6d9fe0ca49d3d0888c9b7abc416eddef3561a2ddae9d9b4898a97080a7e5
MD5 cd39e52ebc0d1da1af4803306d83a198
BLAKE2b-256 43473e7f9d92215f14da62fb00341c8ae074c88b1c3680f29f50484a50037c21

See more details on using hashes here.

File details

Details for the file winkerberos-0.5.0-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for winkerberos-0.5.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 b0265e5a2af14739b66cfad09608312e100ffb20e5ef044c989328ca961580c4
MD5 ca316cd3bdf88281a03cff4b79bc3c54
BLAKE2b-256 eeec40b0a0b0416e865368eb4e0063e28a629117c6c93f980ece87afdd34dd84

See more details on using hashes here.

File details

Details for the file winkerberos-0.5.0-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for winkerberos-0.5.0-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 1e6dd26ce115ee7db78d46d253bfb646276bf25439312ad439d14553812acb85
MD5 3e6e50cfc2f52596648972b97f34e661
BLAKE2b-256 ad18201e1e6a0078b92b4960ab98779abd9f7d5ce60a24eb22a03059d6aca2c6

See more details on using hashes here.

File details

Details for the file winkerberos-0.5.0-cp26-cp26m-win_amd64.whl.

File metadata

File hashes

Hashes for winkerberos-0.5.0-cp26-cp26m-win_amd64.whl
Algorithm Hash digest
SHA256 79481d36ce5bb56fe940985a1273259f7e85505522ebdbbe0c5ebdf9a3c759db
MD5 b70f34dbeaa0bc24849922266ce8a212
BLAKE2b-256 69c0bb49036a0a7e8e8951cf7f606b414950c02eed9c3f602873398c2f1968f5

See more details on using hashes here.

File details

Details for the file winkerberos-0.5.0-cp26-cp26m-win32.whl.

File metadata

File hashes

Hashes for winkerberos-0.5.0-cp26-cp26m-win32.whl
Algorithm Hash digest
SHA256 0dd696d91210f48de632f185f40b5bbbdbb9827a82735ffb1d0d94e64c3a33a8
MD5 5e8e690ad34191820ca966f20ef3d396
BLAKE2b-256 05601fe87e8b76091e8f65eba764a1397a6836e67d1d5d772b79978b2630bf73

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page