2

In a Windows world with Windows clients and a LAMP web server, is it possible to take advantage of Windows Authentication to authenticate a user on the LAMP web site?

The motivations are:

  • Single sign on
  • Be able to access the user name of the Windows user

Edit: Twelve47 found this question and answer, but that only works on IIS unfortunately, so my question is NOT a duplicate of it, as opposed to what I stated 7 hours ago...

Community
  • 1
  • 1
chiccodoro
  • 14,407
  • 19
  • 87
  • 130
  • To the one who voted for closing: Can you please tell me why? – chiccodoro Apr 07 '11 at 15:26
  • Twasn't me, but the person that voted to close thought the question was more appropriate for webmasters.stackexchange.com I think you could also ask your question there, but I'm not voting to close. – Gilbert Le Blanc Apr 07 '11 at 18:24
  • @Gilbert: I see. I regard it as a programming question because I need to know the libraries and code required to use Windows Authentication and to retrieve the user name. – chiccodoro Apr 08 '11 at 08:38

1 Answers1

1

Active Directory can accessed using LDAP, you can then use LDAP in PHP or mod_auth_ldap in apache to query the AD.

You might like to check out adLDAP which a PHP project designed for PHP/AD integration.

Twelve47
  • 3,924
  • 3
  • 22
  • 29
  • LDAP is good for *authorization* (given a name, look up his priveleges), right? But how can I have the client send the user name to the server then? – chiccodoro Apr 07 '11 at 15:42
  • I'm not sure what you mean. Do you mean you want the browser to send details of the client machine's local user account to the server? – Twelve47 Apr 07 '11 at 16:29
  • I have to admit that I don't exactly know how Windows authentication works. In ASP.NET it is a very simple configuration setting. Using that, the user is automatically authenticated when he navigates to the website. His user name is then available to the website. This is necessary of course, to display who you are, and to authorize you based on your user name. I don't need any more details than the user name. – chiccodoro Apr 08 '11 at 08:35
  • @chiccodoro -This might help http://stackoverflow.com/questions/168610/can-you-get-a-windows-ad-username-in-php Looks like it will only work if the client is running IE tho. – Twelve47 Apr 08 '11 at 08:46