From 2156aa710f950cb042979006a30025b0f7861924 Mon Sep 17 00:00:00 2001 From: imacat Date: Thu, 24 Nov 2022 21:34:48 +1100 Subject: [PATCH] Added the instructions on setting the password hash in README.rst. --- README.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.rst b/README.rst index 498bc07..c252853 100644 --- a/README.rst +++ b/README.rst @@ -232,6 +232,24 @@ authentication mechanism. You can change the actual authentication mechanism without changing the views. +Setting the Password Hash +========================= + +The password hash of the HTTP Digest Authentication is composed of the +realm, the username, and the password. Example for setting the +password: + +:: + + from flask_digest_auth import make_password_hash + + user.password = make_password_hash(realm, username, password) + +The username is part of the hash. If the user changes their username, +you need to ask their password, to generate and store the new password +hash. + + Writing Tests =============