Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fetch username

Status
Not open for further replies.

cleanair4me46

Technical User
Feb 3, 2009
41
US
I have two servers in my Intranet environment and we only use Windows workstations to login to the Intranet and view the Intranet web pages. The two web servers in my Intranet are Windows and Solaris. On the Windows Intranet server (with Windows Integrated authentication turned on) I can fetch the Intranet Windows login username using CGI.Auth_User in ColdFusion page. Please advise how I can fetch Windows login username using PHP 5 on Solaris 10 server? I tried many different attempts and none of them printed anything.

Here is what I used:
Code:
echo $_ENV["USERNAME"];
echo $_ENV['USERNAME'];
echo $_SERVER["REMTE_USER"];
echo $_SERVER['REMTE_USER'];
echo $_SERVER['REMOTE_USER'];
echo $_SERVER["REMOTE_USER"];
echo $_SERVER['AUTH_USER'];
echo $_SERVER["AUTH_USER"];
echo $PHP_AUTH_USER;

Please advise.

 
on a solaris server (i.e. not running windows), you want to be able to retrieve the windows username from the client machine that would be sent had the client been interacting with an IIS server that was requested windows integrated authentication.

to my knowledge this cannot logically be achieved.

on IIS using ISAPI php bindings, where integrated auth is set, the user name will be in $_SERVER['PHP_AUTH_USER'].
 
Thanks, still cant get any value. From what you are saying the Solaris server cant turn on authentication and fetch the username from Windows client? Basically there is no way to do this since PHP sits on Solaris and not Windows IIS?
 
there is no way to pick up the windows user id, correct. automatically anyway.

you can always ask a user to enter their proper user name and pwd and then authenticate them using LDAP to access the AD for the domain.
 
Thanks, I will not pursue it anymore in Apache PHP on Solaris but I can use ColdFusion IIS. ColdFusion on my Windows Intranet seems to authenticate and always pick up the correct Windows Intranet username login.
 
that seems logical. the authentication requirements are handled by windows/IIS and so any module that hooks into IIS are bound to be able to get hold of the right values. php would also be able to do this.
 
Great info.
I assume PHP would also be able to do this if it was hosted on my Windows server (instead of Solaris). For Solaris I would always need a 3rd party software to do that?
 
correct. you'd need php as a sapi on windows.

one other thought - if the computers are all on your local subnet then might it be possible to look up the ip address via arp on the mac address, grab the machine name from the dhcp server given the ip address and then grab the logon name from the AD based on the machine name. i'm not a hardcore network nut and i don't use AD, but it might ring some bells?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top