View Full Version : NT Authentication

09-17-2003, 10:56 AM
I'm not sure if this is the right forum for this....

I will be writing an application using PHP and mysql. Just wondering how can I read a users NT username in PHP? I need to do this to determine which NT Groups they are in to determine access.

Anyone done this before - any tips (I'm new to PHP.....)

I have done something before in ASP to read in there NT username and used Permission Checker - is there anything like permission checker in PHP?

09-17-2003, 01:32 PM
I suppose you are talking about Windows Authentication.
I don't think it is possible, because you need the LOGON_USER - servervariable, which i nowhere see included in the PHP documentation.
As far as i see ( http://be2.php.net/features.http-auth ), HTTP authentication is onl supported for Apache

There is an easy way to find out. Run this in a PHP file

foreach ($_SERVER as $key => $value) {
echo "Servervariable : " . $key . " Value:" . $value . "<br />";

end check the output. If your NT-Accounts username doesn't show up anywhere, then you are out of luck.

You could also take a look here for some authentication software (bu i think they will all involve a login dialogbox)

09-17-2003, 02:31 PM
Thanks raf - tried that code but it didn't return my NT username....

Is there any way to return the username? I can have a choice of servers (the architecture isn't fully up yet)...

09-17-2003, 02:40 PM
best bet is to grab an apache NT authentication module and authenticate users that way , check out http://modules.apache.org and search for authentication , I use mod_sspi but its appears no longer supported :(