Solved

using PHP to Authenticate against Active Directory

Posted on 2011-09-14
4
288 Views
Last Modified: 2012-05-12
Is there a way to Authenticate users using a remote Active Directory.   PHP is installed on our servers (Unix) and we don't have a LDAP server.  Active Directory is on a remote server and of course they are using Windows OS.

Can I authenticate to a remote Active Directory without having a LDAP server installed on my end.

If it can be done, please point me to the right direction/example...
0
Comment
Question by:melvint91
4 Comments
 
LVL 6

Assisted Solution

by:yjchong514
yjchong514 earned 150 total points
ID: 36535930
Importing a whole library seems inefficient when all you need is essentially two lines of code...

$ldap = ldap_connect("ldap.example.com")
if($bind = ldap_bind($ldap, $_POST['username'], $_POST['password'])) {  
 // log them in!
} else {  
// error message
}  
0
 
LVL 11

Accepted Solution

by:
Amar Bardoliwala earned 200 total points
ID: 36537191
0
 
LVL 7

Assisted Solution

by:boon86
boon86 earned 150 total points
ID: 36537206
Hi,

check this: http://adldap.sourceforge.net/

adLDAP is a PHP class that provides LDAP authentication and integration with Active Directory.

Intelligent Active Directory integration with PHP was a holy grail for most intranet developers for a long time. This project is really to help others with getting over the same hurdles that we've experienced in getting the whole LDAP SSL Active Directory puzzle working natively on Linux.

Given the varied nature of organisations and sites, adLDAP may not be _your_ complete solution, but it should be a very sound starting point. LDAP isn't overly friendly on first glance, and it's a steep learning curve made alot worse when coupled with Microsoft's seemingly unending army of gotcha's.

The information you can retrieve from Active Directory is as useful as you make it. If you don't fill out all their account information there's not really going to be much to query.

Documentation goes here: http://adldap.sourceforge.net/wiki/doku.php?id=documentation
download goes here: http://adldap.sourceforge.net/download.php

hope it help and suite your need.

Good luck
0
 

Author Closing Comment

by:melvint91
ID: 36812670
I had to still do alot of research from the information provided
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now