コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 1 of about 1 for digest (0.001 sec.)
HTTP Basic Auth 9414
HTTP Basic Auth Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . For the simplest cases, you can use HTTP Basic Auth. In HTTP Basic Auth, the application expects a ... password are correct. For this, use the Python standard module secrets to check the username and password. secrets.compare_digest() needs to take bytes or a str that only contains ASCII characters (the ones in English), this means it wouldn't work with ... handle that, we first convert the username and password to bytes encoding them with UTF-8. Then we can use secrets.compare_digest() to ensure that credentials.username is "stanleyjobson" , and that credentials.password is "swordfish" . Python 3.9+ impo ... dentials . username . encode ( "utf8" ) correct_username_bytes = b "stanleyjobson" is_correct_username = secrets . compare_digest ( current_username_bytes , correct_username_bytes ) current_password_bytes = credentials . password . encode ( "utf8" ) co ...
https://man.mtool.work/fastapi/0.115/advanced/security/http-basic-auth/
PREV 1 NEXT