Registry / http-networking / www-authenticate

www-authenticate

JSON →
library0.9.2pypypi✓ verified 22d ago

This is a tiny Python library designed specifically for parsing complex `WWW-Authenticate` HTTP headers. It simplifies the extraction of authentication scheme names and their parameters, returning them in a `collections.OrderedDict`. The library's last release was in August 2015, indicating it is no longer actively developed or maintained.

pip install www-authenticate
INSTALL
IMPORT
SIG · WWW-AUTHENTICATE
W
www-authenticate
http-networkingpythonv0.9.2
Install
2.4s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.9.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.4s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

parse
from www_authenticate import parse
import www_authenticate

This quickstart demonstrates how to parse a `WWW-Authenticate` header string using the `www_authenticate.parse` function. It simulates a typical header containing multiple authentication challenges (Basic and Digest) and then prints the extracted schemes and their associated parameters.

import www_authenticate # Simulate a WWW-Authenticate header from a server response www_authenticate_header = 'Basic realm="Restricted Area", charset="UTF-8", Digest realm="api", nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", opaque="5ccc069c403ebaf9f0171e9517f40e41"' parsed_challenges = www_authenticate.parse(www_authenticate_header) print("Parsed WWW-Authenticate Challenges:") for scheme, params in parsed_challenges.items(): print(f" Scheme: {scheme}") print(f" Parameters: {params}") # Accessing specific parameters if 'Basic' in parsed_challenges: basic_params = parsed_challenges['Basic'] print(f"\nBasic Realm: {basic_params.get('realm')}") if 'Digest' in parsed_challenges: digest_params = parsed_challenges['Digest'] print(f"Digest Nonce: {digest_params.get('nonce')}")
Debug
Known issues
breakingThe library has not been updated since August 2015 (version 0.9.2). This means it likely does not incorporate modern HTTP authentication standards, security best practices, or bug fixes for issues discovered in the last nine years. It might be incompatible with newer Python versions or produce incorrect results for contemporary authentication schemes.
fix
Consider migrating to actively maintained HTTP client libraries (e.g., `requests`, `httpx`) that have built-in authentication handling or dedicated authentication libraries (`requests-auth`, `Authlib`) which are more robust and secure for parsing and managing authentication flows.
affects: <=0.9.2
gotchaThis library only parses the `WWW-Authenticate` header. It does not handle the full authentication handshake, generate `Authorization` headers, or manage credentials. It is purely a parsing utility.
fix
Understand that `www-authenticate` is a low-level parsing tool. For complete client-side authentication, you will need to implement the logic for constructing and sending `Authorization` headers based on the parsed challenges, typically using a separate HTTP client library.
affects: <=0.9.2
gotchaThe parsing logic might be brittle for malformed or non-standard compliant `WWW-Authenticate` headers, which can occur in the wild. Some newer or less common authentication schemes might not be parsed correctly or fully.
fix
Thoroughly test the library's parsing capabilities against the specific `WWW-Authenticate` headers you expect to encounter. For critical applications, consider using more actively maintained libraries that are regularly updated to handle evolving and diverse header formats.
affects: <=0.9.2
Upgrade
Version history
0.9.2latest on PyPI · released Aug 5, 2015
Audit
Dependencies

No dependency data recorded yet.

Agent activity
39 hits · last 30 days
node
30
OpenAI (training)
2
Resources
www-authenticate — pip install www-authenticate · libregistry