gssapi
Python GSSAPI Wrapper
What it is and what it does
Python-GSSAPI is a wrapper around the GSSAPI C libraries that enables Python applications to perform Kerberos authentication and related security operations. It exposes both a low-level C-style API that closely mirrors RFC 2744 and a high-level, Pythonic object-oriented API for easier integration. The package supports Kerberos as its primary mechanism but is designed to work with other GSSAPI mechanisms as well.
The library handles credential acquisition, context initialization, token exchange, and credential delegation. It includes support for multiple RFC extensions (GSS-API Negotiation, credential storage, SASL extensions, and Kerberos-specific features) and provides detailed error handling through typed exceptions. Installation requires a system GSSAPI implementation and C compiler, but pre-built wheels are available for common platforms and Python versions.
Use it for:
- Implement Kerberos-based single sign-on (SSO) in web applications or services that need to authenticate against Active Directory or MIT Kerberos realms.
- Build client libraries that negotiate authentication using SPNEGO (GSS-API Negotiation Mechanism) for interoperability with Windows and Unix systems.
- Delegate user credentials to backend services while maintaining security boundaries in multi-tier applications.
- Integrate Kerberos authentication into Python-based system administration tools or monitoring agents that operate in enterprise environments.
- Implement mutual authentication and secure token exchange for inter-service communication in distributed systems.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python-GSSAPI wraps the GSSAPI C libraries to provide both low-level RFC 2744-compliant and high-level Pythonic APIs for Kerberos authentication and related security mechanisms.
Yes, if you need Kerberos or GSSAPI authentication in Python and have a working GSSAPI implementation available on your system. The package is production-stable, actively maintained, and provides both low-level and high-level APIs. The main barrier is the system-level dependency on GSSAPI libraries and a C compiler; if those are already in place, installation is straightforward. Not suitable if you lack system GSSAPI support or cannot install a C compiler.
Install
gssapi on PyPI
pip
pip install gssapiuv
uv add gssapipoetry
poetry add gssapiInstalling gssapi
Before you install
Medium install friction due to compiled C extension requiring a working GSSAPI implementation (such as MIT Kerberos) and a C compiler. The package is actively maintained with recent commits and provides pre-built wheels for common platforms and Python versions.
License in practice
ISC license is permissive and imposes minimal restrictions; you can use, modify, and distribute this package with few obligations.
Quickstart
pip install gssapi
from gssapi.raw import acquire_cred, init_context
from gssapi import Name
name = Name(b"user@REALM", name_type=None)
cred = acquire_cred(name=name)
Requires a working GSSAPI implementation (e.g., MIT Kerberos) with header files and a C compiler installed on the system.
Verify before relying
- Whether pre-built wheels cover all target deployment platforms or if source compilation is often needed in practice.
- Performance characteristics and thread-safety guarantees for the free-threading support (marked as beta in PEP 779).
- Real-world compatibility with non-Kerberos GSSAPI mechanisms beyond the documented RFC extensions.
Package facts
| License | ISC (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — decorator |
| Maintenance | aging — 200 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,325,423/month — #2,120 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: gssapi-1.11.1-cp310-cp310-macosx_10_9_x86_64.whl; gssapi-1.11.1-cp310-cp310-macosx_11_0_arm64.whl; gssapi-1.11.1-cp310-cp310-win32.whl; gssapi-1.11.1-cp310-cp310-win_amd64.whl; gssapi-1.11.1-cp311-abi3-macosx_10_9_x86_64.whl; gssapi-1.11.1-cp311-abi3-macosx_11_0_arm64.whl; gssapi-1.11.1-cp311-abi3-win32.whl; gssapi-1.11.1-cp311-abi3-win_amd64.whl; gssapi-1.11.1-cp314-cp314t-macosx_10_15_x86_64.whl; gssapi-1.11.1-cp314-cp314t-macosx_11_0_arm64.whl; gssapi-1.11.1-cp314-cp314t-win32.whl; gssapi-1.11.1-cp314-cp314t-win_amd64.whl; gssapi-1.11.1-cp39-cp39-macosx_10_9_x86_64.whl; gssapi-1.11.1-cp39-cp39-macosx_11_0_arm64.whl; gssapi-1.11.1-cp39-cp39-win32.whl; gssapi-1.11.1-cp39-cp39-win_amd64.whl
Keywords: gssapi, security
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
krb5Wraps the Kerberos 5 C API to provide Python…
permissive · top 5,000 on PyPI
sspilibProvides Python bindings to the Windows SSPI…
permissive · top 5,000 on PyPI
requests-gssapiAdds GSSAPI/Kerberos authentication support to…
permissive · top 15,000 on PyPI
kerberosProvides a high-level Python wrapper for…
permissive · top 5,000 on PyPI
pyspnegoHandles SPNEGO, NTLM, Kerberos, and CredSSP…
permissive · top 1,000 on PyPI
pure-saslpure-sasl is a pure Python client-side SASL…
permissive · top 5,000 on PyPI
k5testk5test sets up isolated Kerberos 5 test…
permissive · top 15,000 on PyPI
pykerberosProvides a Python wrapper for Kerberos (GSSAPI)…
permissive · top 5,000 on PyPI
requests-credsspAdds CredSSP authentication support to the…
permissive · top 15,000 on PyPI
requests-kerberosAdds Kerberos/GSSAPI authentication support to…
permissive · top 5,000 on PyPI