Skip to main content
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, just run the following command:

python setup.py install

Examples

This is a simplified example of a complete authentication session:

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.
    status, ctx = kerberos.authGSSClientInit(service)

    # GSSAPI is a "client first" 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 authentication challenge
    kerberos.authGSSClientUnwrap(ctx, challenge)
    data = kerberos.authGSSClientResponse(ctx)
    # Encrypt a response including the user to authenticate
    kerberos.authGSSClientWrap(ctx, data, user)
    response = kerberos.authGSSClientResponse(ctx)

    # Complete authentication.
    send_response_and_receive_challenge(response)

Documentation

Use the help function in the python interactive shell:

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

Release files for winkerberos 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for winkerberos 0.2.0
File Size Uploaded
winkerberos-0.2.0.zip 34.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for winkerberos 0.2.0
File
winkerberos-0.2.0-cp35-cp35m-win_amd64.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-64 Details
winkerberos-0.2.0-cp35-cp35m-win32.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-32 Details
winkerberos-0.2.0-cp34-cp34m-win_amd64.whl CPython 3.4 CPython 3.4 pymalloc Windows x86-64 Details
winkerberos-0.2.0-cp34-cp34m-win32.whl CPython 3.4 CPython 3.4 pymalloc Windows x86-32 Details
winkerberos-0.2.0-cp33-cp33m-win_amd64.whl CPython 3.3 CPython 3.3 pymalloc Windows x86-64 Details
winkerberos-0.2.0-cp33-cp33m-win32.whl CPython 3.3 CPython 3.3 pymalloc Windows x86-32 Details
winkerberos-0.2.0-cp27-cp27m-win_amd64.whl CPython 2.7 CPython 2.7 pymalloc Windows x86-64 Details
winkerberos-0.2.0-cp27-cp27m-win32.whl CPython 2.7 CPython 2.7 pymalloc Windows x86-32 Details
winkerberos-0.2.0-cp26-cp26m-win_amd64.whl CPython 2.6 CPython 2.6 pymalloc Windows x86-64 Details
winkerberos-0.2.0-cp26-cp26m-win32.whl CPython 2.6 CPython 2.6 pymalloc Windows x86-32 Details

Total release size: 170.0 kB

Release files / winkerberos-0.2.0.zip

Download URL winkerberos-0.2.0.zip
Size 34.3 kB
Tags Source
SHA-256 checksum
How to use checksums
96d04647127d19b12dd317d598b2fb5b183afb3859ba69d06579ffa0aa0d9689
BLAKE2b-256 checksum
How to use checksums
c767450dede2ed5224a545917ac38e581a5bca6485c115e05c3b7b0d4acd902f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / winkerberos-0.2.0-cp35-cp35m-win_amd64.whl

Download URL winkerberos-0.2.0-cp35-cp35m-win_amd64.whl
Size 16.1 kB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
bfc996b6ad02b3bf8f771d83d264f02476188d59f017edb9ff4f3e98926d3e26
BLAKE2b-256 checksum
How to use checksums
db50c9fe87e6cc010fdac46994331d05dea88689d2c4cca903c832b61a8eb0ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / winkerberos-0.2.0-cp35-cp35m-win32.whl

Download URL winkerberos-0.2.0-cp35-cp35m-win32.whl
Size 14.0 kB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
39ddb0c9a845c79c90a428dd10c92b23a5540536f92ac3f419a4453b0e3a2c48
BLAKE2b-256 checksum
How to use checksums
ad23f9db389359cdd9214d8088ac55d43178d19b7395eb575bae66f66ea8d250
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / winkerberos-0.2.0-cp34-cp34m-win_amd64.whl

Download URL winkerberos-0.2.0-cp34-cp34m-win_amd64.whl
Size 13.7 kB
Tags CPython 3.4 CPython 3.4 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
4a13928fc103c789d2017f6fd7c60a45a893c9ab59f523eb0adcb4fe8e30f04a
BLAKE2b-256 checksum
How to use checksums
e551cc17034e34dff09a82aaafffe40792cd2fb3175069af70558b6b412dd91c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / winkerberos-0.2.0-cp34-cp34m-win32.whl

Download URL winkerberos-0.2.0-cp34-cp34m-win32.whl
Size 12.6 kB
Tags CPython 3.4 CPython 3.4 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
7f058289814ea39512a7d7d1c7b3d20a0256e39ce1353e9a34235ea36629a9f0
BLAKE2b-256 checksum
How to use checksums
24d225f9d9f66f1482e382b005fa165178c49c2d584e36ea1c5d134ce2a26974
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / winkerberos-0.2.0-cp33-cp33m-win_amd64.whl

Download URL winkerberos-0.2.0-cp33-cp33m-win_amd64.whl
Size 13.7 kB
Tags CPython 3.3 CPython 3.3 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
07bc3e8e3d002a1172d7042c86e53a4e6c8369a683ef7eaa5f90e763ab7c4a1e
BLAKE2b-256 checksum
How to use checksums
53bf4def9cd508a2b9c2b5013fc8d75303d73686fca00989cfa386ffbc08e9cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / winkerberos-0.2.0-cp33-cp33m-win32.whl

Download URL winkerberos-0.2.0-cp33-cp33m-win32.whl
Size 12.6 kB
Tags CPython 3.3 CPython 3.3 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
956c285971bd0f4703b652c7e585267ebe9b9d3b225ee4968b4a2dcecce15b2e
BLAKE2b-256 checksum
How to use checksums
34f628d537964e76c0f9f0ac3cc83df4479ca4b893b2e715f7c047926e3a8a9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / winkerberos-0.2.0-cp27-cp27m-win_amd64.whl

Download URL winkerberos-0.2.0-cp27-cp27m-win_amd64.whl
Size 13.6 kB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
2dceecf45efec0c69acf5e303944425705f428c73298a81fd3719c0ea8768e0b
BLAKE2b-256 checksum
How to use checksums
bc6393ba29bc793ba8b85e2cd21b3b75399d5130f6297fca720acbf42519fc7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / winkerberos-0.2.0-cp27-cp27m-win32.whl

Download URL winkerberos-0.2.0-cp27-cp27m-win32.whl
Size 12.7 kB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
a10d25d73eb54c92c1fe404cc1659b59c53a04e4e5aad9b96c27bd01c81b9a52
BLAKE2b-256 checksum
How to use checksums
3ba4304ccad9e53072c3aeac9288f15bba7456dcac32ac134b17f9f1777a8925
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / winkerberos-0.2.0-cp26-cp26m-win_amd64.whl

Download URL winkerberos-0.2.0-cp26-cp26m-win_amd64.whl
Size 13.8 kB
Tags CPython 2.6 CPython 2.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
f27a3a11b30d2494807b3609d2f264bbd0f37134dabf1de769ed407dfc72fca2
BLAKE2b-256 checksum
How to use checksums
7940538e2cc855c60e69f8cee8e7129a6b3a487a45cea0b5f91afc751b76b4bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / winkerberos-0.2.0-cp26-cp26m-win32.whl

Download URL winkerberos-0.2.0-cp26-cp26m-win32.whl
Size 13.0 kB
Tags CPython 2.6 CPython 2.6 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
4e996afa6447b200169aa49408bd5e8712002b4c24bda908d811390ccfe4fe82
BLAKE2b-256 checksum
How to use checksums
72e751391ee51372fb14d76e3d87e1c1531cd7ebdd912ce5ef34a4923be8a075
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page