Metadata-Version: 2.1
Name: requests-scram
Version: 1.0.0
Summary: Implements RFC 7804 Salted Challenge Response (SCRAM) HTTP Authentication Mechanism for the Requests library.
Author-email: Michael de Villiers <michael@devilears.co.za>
Maintainer-email: Michael de Villiers <michael@devilears.co.za>
License: MIT
Project-URL: Homepage, https://github.com/COUR4G3/requests-scram/
Project-URL: Source Code, https://github.com/COUR4G3/requests-scram/
Project-URL: Issue Tracker, https://github.com/COUR4G3/requests-scram/issues/
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: scramp

# requests-scram

Implements RFC 7804 Salted Challenge Response (SCRAM) HTTP Authentication Mechanism for the
[Requests](https://requests.readthedocs.io/) library.

See [flask-scram](https://github.com/COUR4G3/flask-scram) for a server-side implementation.

Took much inspiration from [requests-ntlm2](https://github.com/dopstar/requests-ntlm2) and
[requests-gssapi](https://github.com/pythongssapi/requests-gssapi/).


## Getting Started

Initialize ``HTTPSCRAMAuth`` and pass as the ``auth`` parameter to your request or session:

```python
import requests

from requests_scram import HTTPSCRAMAuth

# specify ``mechanisms`` for supported mechanisms (defaults to all non-PLUS)
auth = HTTPSCRAMAuth("user", "pass")

resp = requests.get("http://localhost:5000", auth=auth)
resp.raise_for_status()

print(resp.text)

```


## Todo

- Handle multiple ``WWW-Authenticate`` headers (server would typically advertise multiple SCRAM authentication mechanisms)
- Do something with ``Authentication-Info``?
- Implement [One Round-Trip Reauthentication](https://datatracker.ietf.org/doc/html/rfc7804#section-5.1)


## License

Licensed under the MIT License.
