Get username on Server that uses digest authentication (Perl)

252 views Asked by At

I have a webserver, and on this server I am offering some content that is restricted. Users must log in via digest authentication. This woks fine, since till now all users saw the same content. But now I want to write a cgi-script in Perl, that needs to know the user's name to be able to provide individual content for each user. How can this be be done? How can I get the digest-login-name using perl?

1

There are 1 answers

0
ceving On BEST ANSWER

See the documentation for mod_cgi:

http://httpd.apache.org/docs/2.0/mod/mod_cgi.html

The user name is stored in the environment variable called REMOTE_USER.

Perl stores environment variables in the %ENV hash.