The `gssapi` library provides a Python wrapper for the Generic Security Service Application Programming Interface (GSSAPI), enabling applications to perform secure authentication and communication over various security mechanisms like Kerberos. As of version 1.11.1, it's actively maintained with frequent patch releases and minor updates every few months, often improving platform support and build processes.
pip install gssapiVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create GSSAPI Name objects, which are fundamental for identity representation. Note that `gssapi` requires a system-level GSSAPI C library to function correctly.
Install system-level GSSAPI development packages. Examples include `libkrb5-dev` (Debian/Ubuntu), `krb5-devel` (RHEL/CentOS), or `krb5` (Homebrew on macOS).
Ensure your Python environment is version `3.9` or higher. Refer to the `requires_python` metadata on PyPI for specific version compatibility if targeting an older `gssapi` release.
Avoid installing `gssapi==1.8.0` or `gssapi==1.11.0`. Use `gssapi==1.8.1` or `gssapi==1.11.1` (or newer) instead.
Ensure `Cython` is installed (`pip install Cython`) before attempting to install `gssapi` from source, or use environments where pre-built wheels are readily available.
pip install gssapi
Install the Kerberos development package for your operating system (e.g., `sudo apt-get install libkrb5-dev` on Debian/Ubuntu, `sudo yum install krb5-devel` on RHEL/CentOS/Fedora).
Install MIT Kerberos for Windows and ensure its installation directory containing the DLLs (e.g., `krb5_64.dll`) is in your system's PATH environment variable. For some specific use cases (like `ldap3`), `pip install winkerberos` might provide a transparent alternative.
For users, run `kinit` in your terminal to obtain a Kerberos Ticket Granting Ticket (TGT). For service accounts, ensure a valid Kerberos keytab file exists and the `KRB5_KTNAME` environment variable is set to its path before running the application.