Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

requests_scram-1.0.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

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

Hashes for requests-scram-1.0.1.tar.gz
Algorithm Hash digest
SHA256 62d562b9560ecdbe75e65887833e909404b1d668bba7572ad658db0f4c13567e
MD5 85d7739e0f1fe6a80b728b48cf904c33
BLAKE2b-256 824be5e0ad4bf1f544030f2516c440900765efc3704fc1f616e376c5eb6541ae

See more details on using hashes here.

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

Hashes for requests_scram-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6ab7abcb523dda6a00a4696d582abde56a46022ba592a18c27067a33bd1101a6
MD5 579b1f0714924bcd9bb2c9089c116fd8
BLAKE2b-256 d08c2f36018fe1e1ef78f0d0d7eee27c192effd14e1d68f8dd31c91eccf31782

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page