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+.
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)
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.2.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfc996b6ad02b3bf8f771d83d264f02476188d59f017edb9ff4f3e98926d3e26 |
|
MD5 | c759661cb062ebab000af6838a0b0f04 |
|
BLAKE2b-256 | db50c9fe87e6cc010fdac46994331d05dea88689d2c4cca903c832b61a8eb0ae |
Hashes for winkerberos-0.2.0-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39ddb0c9a845c79c90a428dd10c92b23a5540536f92ac3f419a4453b0e3a2c48 |
|
MD5 | 13431954faf06f40c0b5560d043068d7 |
|
BLAKE2b-256 | ad23f9db389359cdd9214d8088ac55d43178d19b7395eb575bae66f66ea8d250 |
Hashes for winkerberos-0.2.0-cp34-cp34m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a13928fc103c789d2017f6fd7c60a45a893c9ab59f523eb0adcb4fe8e30f04a |
|
MD5 | f59af46c06c105a30c10750b77015e4d |
|
BLAKE2b-256 | e551cc17034e34dff09a82aaafffe40792cd2fb3175069af70558b6b412dd91c |
Hashes for winkerberos-0.2.0-cp34-cp34m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f058289814ea39512a7d7d1c7b3d20a0256e39ce1353e9a34235ea36629a9f0 |
|
MD5 | 94e73f9876d3f68135a476be3d597c3d |
|
BLAKE2b-256 | 24d225f9d9f66f1482e382b005fa165178c49c2d584e36ea1c5d134ce2a26974 |
Hashes for winkerberos-0.2.0-cp33-cp33m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07bc3e8e3d002a1172d7042c86e53a4e6c8369a683ef7eaa5f90e763ab7c4a1e |
|
MD5 | 320179b780957582414167ad604ee759 |
|
BLAKE2b-256 | 53bf4def9cd508a2b9c2b5013fc8d75303d73686fca00989cfa386ffbc08e9cb |
Hashes for winkerberos-0.2.0-cp33-cp33m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 956c285971bd0f4703b652c7e585267ebe9b9d3b225ee4968b4a2dcecce15b2e |
|
MD5 | 9d93e090430fbb31f817528aebbd11ad |
|
BLAKE2b-256 | 34f628d537964e76c0f9f0ac3cc83df4479ca4b893b2e715f7c047926e3a8a9e |
Hashes for winkerberos-0.2.0-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dceecf45efec0c69acf5e303944425705f428c73298a81fd3719c0ea8768e0b |
|
MD5 | 5470ead1e8064bd8cf8d2ffaf03ae190 |
|
BLAKE2b-256 | bc6393ba29bc793ba8b85e2cd21b3b75399d5130f6297fca720acbf42519fc7c |
Hashes for winkerberos-0.2.0-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a10d25d73eb54c92c1fe404cc1659b59c53a04e4e5aad9b96c27bd01c81b9a52 |
|
MD5 | e194c6561990b6ce6c7a411975ad8cb9 |
|
BLAKE2b-256 | 3ba4304ccad9e53072c3aeac9288f15bba7456dcac32ac134b17f9f1777a8925 |
Hashes for winkerberos-0.2.0-cp26-cp26m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f27a3a11b30d2494807b3609d2f264bbd0f37134dabf1de769ed407dfc72fca2 |
|
MD5 | 1b1488d5a5fc324023488105780c2371 |
|
BLAKE2b-256 | 7940538e2cc855c60e69f8cee8e7129a6b3a487a45cea0b5f91afc751b76b4bd |
Hashes for winkerberos-0.2.0-cp26-cp26m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e996afa6447b200169aa49408bd5e8712002b4c24bda908d811390ccfe4fe82 |
|
MD5 | d4f7703042b3a63356877191a3e7d7df |
|
BLAKE2b-256 | 72e751391ee51372fb14d76e3d87e1c1531cd7ebdd912ce5ef34a4923be8a075 |