skillfed

httpx-auth

Authentication for HTTPX

httpx-auth v0.23.1 2.3M downloads/30d#3,185 on PyPI143
Permissive license MIT License Copyright (c) 2024 Colin Bounouar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) AGING released

What it is and what it does

httpx-auth is an authentication layer for the httpx HTTP client library. It provides pre-built authentication classes that integrate directly with httpx's auth parameter, handling the complexity of token retrieval, refresh, and header formatting so you don't have to implement it yourself.

The package supports a wide range of authentication schemes: OAuth2 (Authorization Code, Authorization Code with PKCE, Resource Owner Password Credentials, Client Credentials, and Implicit flows), AWS Signature Version 4, API keys (in headers or query parameters), and basic authentication. It includes built-in support for specific providers like Okta, WakaTime, and Microsoft Entra. The single runtime dependency is httpx itself, and the package is typed for IDE support.

Use it for:

  • Authenticate requests to OAuth2-protected APIs (Okta, Microsoft Entra, WakaTime) using Authorization Code flow with automatic token refresh.
  • Sign AWS API requests with Signature Version 4 without manually computing signatures.
  • Add API key authentication to httpx requests, either as a header or query parameter.
  • Implement OAuth2 Client Credentials flow for service-to-service authentication.
  • Combine multiple authentication methods in a single request when an API requires both.
  • Persist and reuse OAuth2 tokens across multiple requests to avoid repeated authorization steps.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides authentication classes for httpx HTTP client requests, supporting OAuth2 flows, API keys, AWS signatures, and basic auth.

Yes. The package is Production/Stable, has no known vulnerabilities, low install friction, and solves a common problem—integrating authentication with httpx—without requiring you to implement token management yourself. The aging maintenance status (last commit 2026-01-05) is not a blocker for stable use, but monitor the repository for updates if you depend on new OAuth2 flows or provider support.

Install

httpx-auth on PyPI

pip

pip install httpx-auth

uv

uv add httpx-auth

poetry

poetry add httpx-auth

Installing httpx-auth

Before you install

Low install friction with a single runtime dependency (httpx). Maintenance status is aging—last commit was 2026-01-05 with 143 repository stars—but the package is marked Production/Stable and has been actively maintained since its first release in 2020-02-04.

License in practice

MIT License permits free use, modification, and distribution with minimal restrictions. You may use this in proprietary projects without obligation to share your code.

Quickstart

pip install httpx-auth

import httpx
from httpx_auth import OAuth2AuthorizationCode

with httpx.Client() as client:
    client.get('https://www.example.com', auth=OAuth2AuthorizationCode('https://www.authorization.url', 'https://www.token.url'))

Requires Python 3.9 or later. OAuth2 flows that use browser-based authorization will open a local redirect server on port 5000 by default.

Verify before relying

  • Whether token cache persistence works with all OAuth2 flows or has specific limitations.
  • Current stability relative to httpx 1.0.0 release—the package notes it will reach 1.0.0 once httpx stabilizes.

Package facts

License MIT License Copyright (c) 2024 Colin Bounouar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 1 — httpx
Maintenance aging — 584 days since the last release
Last repo commit
First released
Downloads 2,256,935/month — #3,185 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: httpx_auth-0.23.1-py3-none-any.whl

Keywords: authentication, oauth2, aws, okta, aad, entra

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Software Development :: Build ToolsTyping :: Typed

Tags

oauth2 authentication httpxhttp client authenticationapi key authenticationoauth2 authorization code flowaws signature v4basic auth httpxtoken management http
oauth2http-clientauthentication

More Build Tools packages