Welcome to dbFreaks.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Active directory authentication via php.

 
   Database Help (Home) -> PHP RSS
Next:  Can php control USB port on PC?  
Author Message
Kashgarinn

External


Since: Apr 16, 2007
Posts: 1



(Msg. 1) Posted: Mon Apr 16, 2007 10:30 am
Post subject: Active directory authentication via php.
Archived from groups: comp>lang>php (more info?)

Greetings.

I'm in a bit of a pickle.. at the company where I recently started
work, I discovered that the knowledge base we use sucks, and sucks bad
(oh Lotus Notes, how I loathe thee, let me count the ways)

So for kicks and giggles, I found a nice "personal notebook" solution
on the net called: http://www.tiddlywiki.com/

When this had ballooned into a big, nice knowledge base, I discovered
that there's a server-side version of it called cctiddly :
http://cctiddly.sourceforge.net/

So as a test I found a free apache/php/sql solution:
http://www.apachefriends.org/en/xampp.html - copied the cctiddly into
it, and the thing worked!

As you can see, up until now, no real programming has been undertaken
by me, at this point, I've just been at most playing around with
installing plugins into my tiddlywiki.

Of course, also, now I'm faced with the ultimate question... what's
the best way to authenticate people who want access to the wiki?

I've researched a bit, and discovered that you can enable LDAP access
via php, so theoretically you can authenticate people through AD...
which is excellent! People can just use their usual username and
password, no need to remember yet another user/pass, and no need for
admin to have to control yet another admin control thingum.

So I've been testing this out, browsing through information, and as a
test I created this:

------
echo "<h3>LDAP query test #1</h3>";
echo "Connecting ...";
$ldap_host = "localhost";
$ldap_user = "user@domain.is";
$ldap_pass = "password";
$connect = ldap_connect($ldap_host) or die ("No Connection to LDAP
server"); // must be a valid LDAP server!
echo "connect result is " . $connect . "<br />";

if (ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) {
echo "Using LDAPv3 <br />";
} else {
echo "Failed to set protocol version to 3 <br />";
}

if ($connect) {
echo "Binding to server...";
$bind=ldap_bind($connect, $ldap_user, $ldap_pass);
echo "Bind result is " . $bind . "<br />";
}
----
- Now this works.. if I remove the $ldap_pass in the
"$bind=ldap_bind($connect, $ldap_user, $ldap_pass); " line, because
then I'm connecting anonymously to the LDAP server...

But when I try to authenticate to the server with the password I get
this error:

"Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server:
Strong(er) authentication required in C:\Program Files\xampp\htdocs
\wiki\adtest.php on line 21"

- which made me go, whu?

Now I can't change the settings on the domain controller, as I'm not
the sysadmin.. so I need to somehow create a stronger authentication
to the server.. now how the hell do I do that?

I can't install an SSL certificate, because there isn't one on the
server, is there some way for me to make the password meet the bare
minimum requirements for a stronger authentication without having to
use SSL?

An administratoir I know recommended to try to figure out how to use
either NTLM or KERBEROS... which is at least perhaps something.

Can anyone give me any tips, however vague on how I could do this?

Thanks for any replies.

 >> Stay informed about: Active directory authentication via php. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Active directory and PHP - Is there anyway to work PHP with Active directory? My intention consist in developing an application that authenticates automatically PHP on W2k3 server. tks, Marcos

creating active directory user - does anyone already tried to create a user into active directory through php_ldap ? i tried something like this but still don't work :-/ $adduserAD["cn"][0] = "phpldapuser"; $adduserAD["samaccountname"][0] = "gug...

authentification on Active Directory with LDAP - Hello, my english is not so good. I want to use the users of our active directory in the intranet for a portal page. i dont know how to authenticate? $server = "xxx-xx.de.xx.com"; $connectid = @ldap_connect($server); is ok. $binding =..

Authenticating users from Windows Active Directory from PH.. - I want to authenticate users (defined in an Active Directory Service running on a Windows 2000 Server machine) from PHP Code running under Linux (Fedora Core 3 with Kerberos 5 installed). I just want to find out whether a particular user (with a given..

unable to connect to active directory server - I'm trying to connect to an Active Directory server and am having some difficulties. Here's the code I'm using: <?php if (!($ldap = ldap_connect('domain.tld')) { exit('unable to connect'); } ldap_bind($ldap, 'username', 'password'); ?> With th...
   Database Help (Home) -> PHP All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]