The library does not provide own solution to check user passwords but accepts any class that
implements PasswordVerifier
protocol in places where it needs to check the password.
You also can use passlib as is with this library.
The password gets verified in login/logout flow and by HTTP Basic Authenticator.
Install passlib before using it
from passlib.hash import pbkdf2_sha1
from imia import LoginManager
login_manager = LoginManager(password_verifier=pbkdf2_sha1, ...)
A custom verifier is a class that has verify(plan, hashed) -> bool
method.
from imia import LoginManager
class MyPasswordVerifier:
def verify(self, plain: str, hashed: str) -> bool:
return hashed == plain
login_manager = LoginManager(password_verifier=MyPasswordVerifier(), ...)
Proceed to login/logout flow