requests-kerberos
A Kerberos authentication handler for python-requests
What it is and what it does
requests-kerberos is a handler that plugs Kerberos/GSSAPI authentication into the requests HTTP library. It allows you to make HTTP requests to Kerberos-protected servers (typically in enterprise Windows/Active Directory environments) by transparently handling the Kerberos authentication handshake. The package wraps requests' auth parameter and manages ticket acquisition, mutual authentication verification, and credential delegation.
You use it by instantiating HTTPKerberosAuth() and passing it to any requests method. It supports multiple authentication modes (REQUIRED, OPTIONAL, DISABLED mutual authentication), preemptive ticket presentation for persistent connections, hostname override for load-balanced services, explicit principal/password authentication, and credential delegation. The package depends on requests, cryptography, and pyspnego, and requires system-level Kerberos libraries on Linux.
Use it for:
- Authenticate HTTP requests against Windows domain controllers or Kerberos-protected corporate APIs without embedding passwords in code.
- Automate WinRM or other Windows service interactions from Python scripts in Active Directory environments.
- Build integration tools that need to respect mutual authentication requirements from enterprise Kerberos realms.
- Delegate credentials to downstream services while maintaining audit trails in Kerberos-managed networks.
- Override hostname resolution for Kerberos authentication when connecting through load balancers or proxies with mismatched DNS names.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds Kerberos/GSSAPI authentication support to the requests HTTP library, enabling secure authentication against Kerberos-protected servers with optional mutual authentication.
Yes, if you need Kerberos authentication for HTTP requests in an enterprise environment. The package is stable and permissively licensed, but install friction is moderate on Linux (system libraries required) and maintenance is dormant—verify compatibility with your Kerberos infrastructure before relying on it for new projects. No known vulnerabilities as of the query date.
Install
requests-kerberos on PyPI
pip
pip install requests-kerberosuv
uv add requests-kerberospoetry
poetry add requests-kerberosInstalling requests-kerberos
Before you install
Low install friction with a pure-Python wheel distribution. Dormant maintenance (last release 802 days ago) but no recent vulnerabilities; on Linux you must pre-install system Kerberos libraries (libkrb5-dev or krb5-devel) and Python development headers before installing this package.
License in practice
ISC License is permissive and imposes minimal restrictions; you may use, modify, and redistribute this package freely in commercial or private projects with only attribution required.
Quickstart
pip install requests-kerberos
import requests
from requests_kerberos import HTTPKerberosAuth
r = requests.get("http://example.org", auth=HTTPKerberosAuth())
On Linux: gcc, Python development headers, and libkrb5-dev (Debian) or krb5-devel (EL) must be installed before pip install. A valid Kerberos credential cache (via kinit) or explicit principal/password is required at runtime.
Verify before relying
- Current compatibility with modern Kerberos implementations and whether the 802-day gap since last release affects support for recent Kerberos protocol changes.
- Whether pyspnego dependency fully replaces or supplements the underlying Kerberos C library requirements on all platforms.
Package facts
| License | ISC License (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — requests, cryptography, pyspnego |
| Maintenance | dormant — 802 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,585,191/month — #2,067 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: requests_kerberos-0.15.0-py2.py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
minikerberosA pure-Python Kerberos client library…
permissive · top 15,000 on PyPI
requests-gssapiAdds GSSAPI/Kerberos authentication support to…
permissive · top 15,000 on PyPI
requests-negotiate-sspiAdds HTTP Negotiate authentication…
permissive · top 15,000 on PyPI
requests-credsspAdds CredSSP authentication support to the…
permissive · top 15,000 on PyPI
asyauthProvides unified authentication handling across…
unclear · top 15,000 on PyPI
pykerberosProvides a Python wrapper for Kerberos (GSSAPI)…
permissive · top 5,000 on PyPI
winkerberosProvides native Kerberos client authentication…
permissive · top 5,000 on PyPI
kerberosProvides a high-level Python wrapper for…
permissive · top 5,000 on PyPI
sspilibProvides Python bindings to the Windows SSPI…
permissive · top 5,000 on PyPI
k5testk5test sets up isolated Kerberos 5 test…
permissive · top 15,000 on PyPI