skillfed

requests-kerberos

A Kerberos authentication handler for python-requests

requests-kerberos v0.15.0 5.6M downloads/30d#2,067 on PyPI306
Permissive license ISC License DORMANT released

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-kerberos

uv

uv add requests-kerberos

poetry

poetry add requests-kerberos

Installing 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

License :: OSI Approved :: ISC License (ISCL)

Tags

kerberos authentication requestsgssapi http authkerberos http clientwindows integrated authenticationnegotiate auth pythonkerberos ticket authenticationactive directory http auth
kerberosenterprise-authwindows-integration

More WWW/HTTP packages