High level interface to SSPI for Kerberos client auth
Project description
- Info:
See github for the latest source.
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+.
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for winkerberos-0.1.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6927f9c5b2df3f9e99846bc763ffee62e198687efd740418e1ef8aca1e7ed58 |
|
MD5 | 486fc2d8decab014ca3a615efe132170 |
|
BLAKE2b-256 | 4ea20a048eee8bc5435003ad226b74fb342f4bbc6515f62295e48df5b091d101 |
Hashes for winkerberos-0.1.0-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fa3f2946b4979ac75179892b7873d50b97c797ecac9782bf5398922715abcbb |
|
MD5 | 11a011b3cf2f6448d789912fa13e3755 |
|
BLAKE2b-256 | d5c159df5494eab7a306c712db53fd1685681888ed8622822b6c8ffb311c33a2 |
Hashes for winkerberos-0.1.0-cp34-cp34m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15254c0b57716a16befd3e78870635ec5c489dd1f6623134c2786460facb8d50 |
|
MD5 | 95d2a202a2b8b72409138b67bd1b86c4 |
|
BLAKE2b-256 | ff37cec1a975aeb1a2c7111067187d5a5a9d30e0f07c03216ad0f70113ccfa5d |
Hashes for winkerberos-0.1.0-cp34-cp34m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13647d24d700f26c00d2ab14af0680f2823ab7971096c1030d4bd8b40264e970 |
|
MD5 | f12f7d986f0f4e84974fb7772a62efd1 |
|
BLAKE2b-256 | 4424d7327c307b4a49610f5a7879dce8f2a4cf53e71f8958e3219b31d9eda483 |
Hashes for winkerberos-0.1.0-cp33-cp33m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bad425358a7321e7ab56b1c13c3603194b0a42f4f0cfc206bb52294a081cfcbe |
|
MD5 | 29cb4dc7914662eb25fc0af61bd989bd |
|
BLAKE2b-256 | f44754cfd146b3c10e6a0bbb75c7a955d18581442004071de6071b3ac52a812c |
Hashes for winkerberos-0.1.0-cp33-cp33m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e53c070f47ecbf939b852812cd1fdb60a5e67b98721c6951958ac7930a86114e |
|
MD5 | dedd0c09712f860439b812ceb0616633 |
|
BLAKE2b-256 | 9cf5a799d01dbb871a437829ba66ab08e9ec059ab4b06a35993e225aa8804833 |
Hashes for winkerberos-0.1.0-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d922342ab49ca08eb20c8fc5b3d058e785a0d6a53107ce23af39cae5d13707e1 |
|
MD5 | 78b3f7b015a6dabbab55e6dbdf02f570 |
|
BLAKE2b-256 | 372c86de1adcb60ebc4c3ef69e1b7219342fe982f1fc655fabae418f5cc1050a |
Hashes for winkerberos-0.1.0-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8810289dbc1607cb8fa604f38dc47347a17e641c39af473196c4672373214534 |
|
MD5 | 92c4da1336bf866d590d55c063ca5382 |
|
BLAKE2b-256 | d6cc557bd54323fa245511df10ba4348a30a8e5022d5f63417e0d308c07306b7 |
Hashes for winkerberos-0.1.0-cp26-cp26m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efed85bec4e9a36dce7470d318a1b56ade618a9d1519a5df2b2e908af7aaf88d |
|
MD5 | 8496ca4bd7488b1894cdecb6e1802514 |
|
BLAKE2b-256 | 2625cd5756fe7a11d5c8573099a8e0a2f51d95ba9af5057d2e8b02bdc3afb9d9 |
Hashes for winkerberos-0.1.0-cp26-cp26m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fd852ee51c8e0c6f0560c4caba103ad7e63fc79b908076334668bf6885eb4e4 |
|
MD5 | 529072a0c75ecddd5b369feaddb2f313 |
|
BLAKE2b-256 | ccb0df8a58b1768802a60a2e8217f762c3ce53303b5632ad1b8944a5ac85eba1 |