Kerberos API bindings for Python
Maintained. Last release 3 months ago, commits in 1 of the last 26 weeks. Weaker on commit activity and release cadence.
pip install krb5Python Kerberos 5 Library
This library provides Python functions that wraps the Kerberos 5 C API. Due to the complex nature of this API it is highly recommended to use something like python-gssapi which exposes the Kerberos authentication details through GSSAPI.
Requirements
- An implementation of the Kerberos 5 API - including the header files
- MIT Kebreros - Minimum 1.17
- Heimdal
- A C compiler, such as GCC
- Python 3.9+
Note: macOS includes their own implementation of Heimdal and a compiler isn't needed on that platform if installing from the wheel.
Installation
Simply run:
pip install krb5
To install from source run the following:
git clone https://github.com/jborean93/pykrb5.git
python -m pip install build
python -m build
pip install dist/krb5-*.whl
Compiling the code should automatically pick up the proper paths for the KRB5 headers and locations. If further customisation is needed, the following environment variables can be set when building the wheel:
KRB5_KRB5CONFIG- The path to
krb5-configto use for detecting the Kerberos library to link to - The compiler and linker args are derived from what this function outputs
- Defaults to whatever
krb5-configis on thePATH - FreeBSD will default to
/usr/local/bin/krb5-configinstead of/usr/bin/krb5-config
- The path to
KRB5_MAIN_LIB- The path to the
libkrb5shared library used to check if any of the optional functions are available
- The path to the