Page 1 of 1
Retrieving Windows Logon Username and Password??
Posted: Tue Apr 15, 2003 3:58 am
by MikeyB
Does anyone know of a way of getting the username and password from the windows logon into a PHP session?
I am using this method for an Intranet which I am currently working on.
Posted: Tue Apr 15, 2003 4:41 am
by oQEDo
If the permissions of the web are set such as to disallow ananymous access then the logged on username can be trapped and put in a session using:
Code: Select all
<?php
$_SESSIONї'UserName'] = getenv("AUTH_USER")
?>
It is impossible to get the windows password into a php session (unless you ask for it on a php page!) as to use the password in any way you would have to know the windows encryption algorythm (as passwords are stored encrypted)
If you are using the windows login as security for certain parts of your intranet, the AUTH_USER should be all that you need.
Posted: Tue Apr 15, 2003 10:20 am
by m3mn0n
Mission
Impossible.

LDAP
Posted: Tue Apr 15, 2003 6:31 pm
by elfgeek
I belive it is possible to authenticate using a windows server via LDAP:
http://www.php.net/manual/en/ref.ldap.php
I've never done it, but it's worth looking into.
greg