Retrieving Windows Logon Username and Password??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
MikeyB
Forum Newbie
Posts: 1
Joined: Tue Apr 15, 2003 3:58 am

Retrieving Windows Logon Username and Password??

Post 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.
User avatar
oQEDo
Forum Commoner
Posts: 43
Joined: Thu Feb 20, 2003 11:08 am
Location: UK

Post 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&#1111;'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.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Mission Impossible. :?
elfgeek
Forum Newbie
Posts: 1
Joined: Tue Apr 15, 2003 6:31 pm
Location: Bellingham, WA
Contact:

LDAP

Post 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
Post Reply