[mod_python] About authentication

Gregory (Grisha) Trubetskoy grisha at modpython.org
Wed Jan 30 14:00:20 EST 2002


No passwdord is not an unusual condition - your code should deal with
users who do not supply passwords by returning them HTTP_UNAUTHORIZED.

So something like:

if password:
	md5.new(password).hexdigest()
else:
	return apache.HTTP_UNAUTHORIZED

On Thu, 4 Oct 2001 nineclue at bigfoot.com wrote:

> I'm trying to implement custom authentication using authenhandler.
> I want to save user info and password in encrypted file that other users
> can only read. So I've tried to use md5.new('password').hexdigest().
> 'password' is a variable that stores password using
> req.get_basic_auth_pw().
>
> When I've tried to load restricted page, I got error saying 'password'
> variable is not read-only buffer, but None. I can use direct comparison
> of username and password with string as to the mod_python document, but I
> can't use it in a function that accepts string as a argument.
>
> Any comment or help would be appreciated.
> mod_python is 2.7.2.
>
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://www.modpython.org/mailman/listinfo/mod_python
>




More information about the Mod_python mailing list