Page 1 of 1

NTLM Authentication

Posted: Mon Mar 03, 2008 12:13 pm
by stealth86
Hi,

I'm using the mod_auth_sspi for apache 2.2 (in windows), to do NTLM authentication. I have it setup, and it works fine. Trying to access a protected page properly authenticates the user.

What I haven't been able to figure out, is what do I need to do to get the username of the person who just authenticated?

I've enabled authentication by adding these lines to my apache http.conf file.

Code: Select all

LoadModule sspi_auth_module modules/mod_auth_sspi.so
 
<Location /--Removed-->
        AuthName "--Removed--"
        AuthType SSPI
        SSPIAuth On
        SSPIAuthoritative On
        SSPIOfferBasic On
        # SSPIBasicPreferred
        # SSPIUsernameCase lower
        require valid-user
</Location>
I've also noticed that this module doesn't seem to be in active development anymore. Are there better modules for apache on windows to do NTLM Authentication?

Thanks!

Re: NTLM Authentication

Posted: Mon Mar 03, 2008 12:29 pm
by stealth86
Well, it seems I answered my own question :oops: .

Code: Select all

$cred = explode('\\',$_SERVER['REMOTE_USER']);
if (count($cred) == 1) array_unshift($cred, "(no domain info - perhaps SSPIOmitDomain is On)");
list($domain, $user) = $cred;
 
echo "You appear to be user <B>$user</B><BR/>";
echo "logged into the Windows NT domain <B>$domain</B>";
I am still curious about my second question however.
I've also noticed that this module doesn't seem to be in active development anymore. Are there better modules for apache on windows to do NTLM Authentication?

Thanks!

Re: NTLM Authentication

Posted: Wed Feb 08, 2012 2:08 am
by phantom82
Hello Stealth68,

Been years you posted and I am stuck with it now.

I am trying to have the single sign on for an Intranet site. The site is setup on Apache 2.2 on Windows 2008 server. The users need to be authenticated against AD thats Windows 2008 Server. Now I have implemented the SSPI module for Apache but no use. I can't even see the REMOTE_USER server variable when queried through phpinfo(); function. Echoing the variable gives you blank results so it's not capturing the username.