skillfed

gssapi

Python GSSAPI Wrapper

gssapi v1.11.1 5.3M downloads/30d#2,120 on PyPI116
Permissive license ISC AGING released

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 gssapi

uv

uv add gssapi

poetry

poetry add gssapi

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: CythonProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Free Threading :: 2 - BetaProgramming Language :: Python :: Implementation :: CPythonTopic :: SecurityTopic :: Software Development :: Libraries :: Python Modules

Tags

kerberos authentication pythongssapi wrapperkerberos client libraryspnego negotiationcredential delegationgss-api bindings
kerberosauthenticationenterprise-security

More Python Modules packages