I need to retrieve the username of the windows user logged in currently when he is accessing my intranet page. I am trying to authenticate my webpage using SSPI(mod_auth_sspi.so) on Windows Server 2008, with Apache 2.2. I have made the following changes to the httpd.conf file and added my intranet site to the trusted sites on browser settings. My webpage is in Perl and am using CGI.pm. I am attempting to retrieve the username via $cgi->user_name() and $cgi->remote_user() and also, checking for the REMOTE_USER and AUTH_USER cgi ENV Variables to get the username.
<IfModule !mod_auth_sspi.c>
LoadModule sspi_auth_module modules/mod_auth_sspi.so
</IfModule>
<Directory "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/TestWeb/">
<Files Test.pl>
AuthName "TestWeb"
AuthType SSPI
SSPIAuth On
SSPIAuthoritative On
SSPIOfferBasic Off
Require valid-user
SSPIDomain domain name
</Files>
</Directory>
I have restarted apache after the changes. I don't see the cgi Environment variable to get the userid in the environment variables. I have searched the same forum and others and this is what they have all done and seems to work. Am I missing something? Appreciate any help.
Thanks