Registry / auth-security / gssapi

gssapi

JSON →
library1.12.0pypypiunverified

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 gssapi
INSTALL
IMPORT
SIG · GSSAPI
G
gssapi
auth-securitypythonv1.12.0
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

gssapi
import gssapi
Name
from gssapi import Name
SecurityContext
from gssapi import SecurityContext
KRB5_NT_PRINCIPAL_NAME
from gssapi.names import KRB5_NT_PRINCIPAL_NAME

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.

import gssapi from gssapi.names import KRB5_NT_PRINCIPAL_NAME, NT_HOSTBASED_SERVICE # GSSAPI operations heavily rely on an underlying C GSSAPI library # (e.g., Kerberos dev headers) being installed on the system. # This example will likely raise GSSError if not properly configured. try: # Example 1: Create a Kerberos principal name user_principal = "username@REALM.EXAMPLE.COM" name_user = gssapi.Name(user_principal, KRB5_NT_PRINCIPAL_NAME) print(f"Created user principal name: {name_user.display_name}") # Example 2: Create a host-based service name service_principal = "host/hostname.example.com@REALM.EXAMPLE.COM" name_service = gssapi.Name(service_principal, NT_HOSTBASED_SERVICE) print(f"Created service principal name: {name_service.display_name}") except gssapi.exceptions.GSSError as e: print(f"WARNING: GSSAPI operation failed. " f"Ensure a GSSAPI C library (e.g., Kerberos dev headers) is installed and configured on your system. Error: {e}") except ImportError: print("ERROR: 'gssapi' library not found. Please install it using 'pip install gssapi'.")
Debug
Known issues
gotchaThe `gssapi` library is a Python wrapper for an underlying C GSSAPI library. This external C library (e.g., Kerberos development headers) must be installed on your system separately. `pip install gssapi` only installs the Python binding, not the core GSSAPI implementation.
fix
Install system-level GSSAPI development packages. Examples include `libkrb5-dev` (Debian/Ubuntu), `krb5-devel` (RHEL/CentOS), or `krb5` (Homebrew on macOS).
affects: All versions
breakingThe minimum required Python version has increased over time. As of version `1.11.1`, Python `3.9+` is required. Older versions like `1.8.1` required `3.7+`.
fix
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.
affects: 1.8.1+
breakingRelease `v1.8.0` was yanked from PyPI due to a critical bug related to its `requires_python` metadata. Release `v1.11.0` was also not properly pushed to PyPI due to a classifier bug and should be avoided.
fix
Avoid installing `gssapi==1.8.0` or `gssapi==1.11.0`. Use `gssapi==1.8.1` or `gssapi==1.11.1` (or newer) instead.
affects: 1.8.0, 1.11.0
gotchaBuilding `gssapi` from source (e.g., if no pre-built wheels are available for your OS/Python version) requires `Cython` to be installed. While `pip` usually handles this for PEP 517 sdist, explicit pre-installation of `Cython` can prevent build failures in some environments.
fix
Ensure `Cython` is installed (`pip install Cython`) before attempting to install `gssapi` from source, or use environments where pre-built wheels are readily available.
affects: All versions when building from source
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'gssapi'
The 'gssapi' Python package is not installed in the active Python environment.
fix
pip install gssapi
krb5-config: command not found
The 'gssapi' Python library requires system-level Kerberos development headers and configuration utilities (`krb5-config`) to be present during its installation, which are not found in the system's PATH or are not installed.
fix
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).
ImportError: DLL load failed: The specified module could not be found
On Windows, the 'gssapi' library relies on a system-wide Kerberos installation (e.g., MIT Kerberos for Windows) to provide necessary DLLs, which are either missing or not correctly configured in the system's PATH.
fix
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.
gssapi.error.NoCredential: (458752) No credentials were supplied, or the credentials were unavailable or inaccessible.
The Python application attempting to use GSSAPI does not have valid Kerberos credentials accessible to the GSSAPI library, meaning the user hasn't authenticated (e.g., with `kinit`) or a service principal's keytab is not properly configured.
fix
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.
Upgrade
Version history
1.12.0latest on PyPI · released Aug 26, 2026
Audit
Dependencies
cffirequiredUsed for Python's Foreign Function Interface to interact with the underlying C GSSAPI library.
cryptographyrequiredProvides cryptographic primitives and secure communication utilities leveraged by the GSSAPI wrapper.
Agent activity
22 hits · last 30 days
node
18
OpenAI (training)
1
Resources
gssapi — pip install gssapi · libregistry