Skip to main content

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.

Metadata

Release files for requests-scram 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for requests-scram 1.0.1
File Size Uploaded
requests-scram-1.0.1.tar.gz 7.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for requests-scram 1.0.1
File Interpreter ABI Platform
requests_scram-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.2 kB

Release files / requests-scram-1.0.1.tar.gz

Download URL requests-scram-1.0.1.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
62d562b9560ecdbe75e65887833e909404b1d668bba7572ad658db0f4c13567e
BLAKE2b-256 checksum
How to use checksums
824be5e0ad4bf1f544030f2516c440900765efc3704fc1f616e376c5eb6541ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / requests_scram-1.0.1-py3-none-any.whl

Download URL requests_scram-1.0.1-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ab7abcb523dda6a00a4696d582abde56a46022ba592a18c27067a33bd1101a6
BLAKE2b-256 checksum
How to use checksums
d08c2f36018fe1e1ef78f0d0d7eee27c192effd14e1d68f8dd31c91eccf31782
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page