Getting User Name With Apache Basic Authentication
Kurt Jansen
KurtJansen at go.com
Fri Aug 24 18:30:36 EDT 2001
Thanks Oleg,
I had to password protect my cgi-bin directory also with .htaccess, and then this environment variable worked. I accessed it with the os.environ['REMOTE_USER'] function.
Kurt
-----Original Message-----
From: "Oleg Broytmann"<phd at phd.pp.ru>
To: "Kurt Jansen"<KurtJansen at go.com>
Cc: python-list at python.org
Date: Fri Aug 24 01:02:22 PDT 2001
Subject: Re: Getting User Name With Apache Basic Authentication
>On Thu, 23 Aug 2001, Kurt Jansen wrote:
>> I would like to set up password protected directories for my Web site
>> (Apache) using the htpasswd/.htaccess. This means that whenever a user
>> requests a page in the protected directory, they get prompted for a
>> userid/password. I would like to capture the userid that the user enters
>> from within my Python CGI script. This seems like it would be a common
>> thing to do, but I can't find anything in the Python library or this
>> newsgroup that addresses it. Anyone have any suggestions?
>
> It has nothing with Python library. User name is available to a CGI
>program in OS environment. Just read CGI specification and figure it out.
>The variable name is REMOTE_USER. I hope you can read env vars in Python.
>
>Oleg.
>----
> Oleg Broytmann http://phd.pp.ru/ phd at phd.pp.ru
> Programmers don't die, they just GOSUB without RETURN.
>
___________________________________________________
GO.com Mail
Get Your Free, Private E-mail at http://mail.go.com
More information about the Python-list
mailing list