Current location: Hot Scripts Forums » Programming Languages » PHP » PHP - Windows Authentication


PHP - Windows Authentication

Reply
  #1 (permalink)  
Old 07-08-08, 05:45 AM
creativeartist creativeartist is offline
Newbie Coder
 
Join Date: Jul 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
PHP - Windows Authentication

I have PHP website running on an apache 2.2 webserver which is in a Windows Network. All users log in on their computers with a network account.

If this is the case I would need to get their network account user name for the each person's login.So the login to website will be authenticated using their username

How can I get this using php???.Please help me on this
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 07-08-08, 05:58 AM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
im pretty sure that cant be done with php alone. what you might be able to do is make a login script on the server and have that interact with something somewhere.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 07-08-08, 06:06 AM
creativeartist creativeartist is offline
Newbie Coder
 
Join Date: Jul 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
how can I do this thats my question.What PHP or apache method need to be used for this??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 07-08-08, 06:20 AM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
if you want a complete solution then Script requests is the correct forum to post in.
And when i mentioned login script i meant Visual Basic on the windows server that authenticates users as then log in on their computers. It Might be possible to have that talk to a database server that stores their logged in state and which computer that is on. Doing this with purely php is as far as i know impossible.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 07-08-08, 07:15 AM
bizzar528's Avatar
bizzar528 bizzar528 is offline
Community Liaison
 
Join Date: Sep 2004
Location: Pennsylvania, US
Posts: 1,551
Thanks: 2
Thanked 16 Times in 15 Posts
I've done something like this and there's a simple method I worked on early in my career. You'll need to know how AD works in order to properly authenticate with it.

The theory behind it is using the AD connection functions provided in PHP. Basically you'll use php to connect to AD and bind to it. If the binding succeeds, then the user account is valid. If the bind fails, then there's a problem with the login information. I'm not 100% sure what happens with user accounts that are disabled, but it's something to test for.

You can use a class like this... http://adldap.sourceforge.net/

Or build a custom solution like this guy...
http://bytes.com/forum/thread633375.html

This function is pretty much what your looking for...
http://www.php.net/ldap_bind

The hardest part for me was learning how LDAP worked, but once you figure it out, it's pretty easy to work with.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 07-08-08, 07:23 AM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
I tought that he wanted a method to auto auth people for hes website based on the username provided on windows login
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 07-08-08, 08:10 AM
bizzar528's Avatar
bizzar528 bizzar528 is offline
Community Liaison
 
Join Date: Sep 2004
Location: Pennsylvania, US
Posts: 1,551
Thanks: 2
Thanked 16 Times in 15 Posts
If that's the case, javascript could probably pull that info, but i can't imagine that being a secure solution for a website. If anyone doesn't lock their workstation, then anyone can sit down and access the site as that user.

Plus php is a server side language so there would need to be some sort of cross-over language like java or javascript to get that info.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 07-09-08, 12:04 AM
creativeartist creativeartist is offline
Newbie Coder
 
Join Date: Jul 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks

But how can I use the javascript to do this.Do you know how to do this with javascript??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #9 (permalink)  
Old 07-09-08, 10:40 AM
bizzar528's Avatar
bizzar528 bizzar528 is offline
Community Liaison
 
Join Date: Sep 2004
Location: Pennsylvania, US
Posts: 1,551
Thanks: 2
Thanked 16 Times in 15 Posts
From what I was reading, sounds likeyou'll have to do it using an activex control.

But start here... should help...
http://www.google.com/search?hl=en&q...ndows+username
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #10 (permalink)  
Old 07-09-08, 05:18 PM
Kelvin Kelvin is offline
Newbie Coder
 
Join Date: Apr 2004
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
I played about with this sometime ago, and found 2 solutions, also 1 very important piece of info is that Windows User details are only passed via IE (it will not work with Firefox) and the site MUST be defined in IE's Intranet zone.

First one is called Plexcel, which is an extension for PHP and works very well, the developer is also friendly and was very helpful. Note this is a commercial product, but its free if you have less than 50 users (PLEASE VERIFY THIS, it may be less or might have changed)

http://www.ioplex.com/

The other is an Apache module

http://adldap.sourceforge.net/wiki/d...h_ntlm_winbind

Cheers
Kelvin
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Count requesters from an apache log file ddolddolee82 Perl 1 03-17-06 04:08 AM
Web Hosting plan Reviews $ 55 Per Only Year megawebserver Website Reviews 0 09-05-05 02:10 PM
PHP on Windows DLL/OCX wizkid PHP 2 08-31-05 08:23 PM
forms authentication looking like windows based junkie_xl ASP.NET 0 05-09-05 11:00 AM
Unable to connect to MSSQL with PHP through a firewall whiplashdomain PHP 1 01-31-04 08:17 PM


All times are GMT -5. The time now is 06:47 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.