redesigned to match https://github.com/francisluong/py-auth-userpass