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-authenticateVerified import paths — ran on the pinned version, not inferred.
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.
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.
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.
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.
No dependency data recorded yet.