Implements RFC 7804 Salted Challenge Response (SCRAM) HTTP Authentication Mechanism for the Requests library.
Project description
requests-scram
Implements RFC 7804 Salted Challenge Response (SCRAM) HTTP Authentication Mechanism for the Requests library.
See flask-scram for a server-side implementation.
Took much inspiration from requests-ntlm2 and requests-gssapi.
Getting Started
Initialize HTTPSCRAMAuth
and pass as the auth
parameter to your request or session:
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
License
Licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
requests-scram-1.0.1.tar.gz
(7.0 kB
view details)
Built Distribution
File details
Details for the file requests-scram-1.0.1.tar.gz
.
File metadata
- Download URL: requests-scram-1.0.1.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62d562b9560ecdbe75e65887833e909404b1d668bba7572ad658db0f4c13567e |
|
MD5 | 85d7739e0f1fe6a80b728b48cf904c33 |
|
BLAKE2b-256 | 824be5e0ad4bf1f544030f2516c440900765efc3704fc1f616e376c5eb6541ae |
File details
Details for the file requests_scram-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: requests_scram-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ab7abcb523dda6a00a4696d582abde56a46022ba592a18c27067a33bd1101a6 |
|
MD5 | 579b1f0714924bcd9bb2c9089c116fd8 |
|
BLAKE2b-256 | d08c2f36018fe1e1ef78f0d0d7eee27c192effd14e1d68f8dd31c91eccf31782 |