Created
January 8, 2015 13:11
-
-
Save redknitin/c215ed780ec6ae03ef70 to your computer and use it in GitHub Desktop.
LDAP Authentication through PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'Net/LDAP2.php'; | |
$cfg = array( | |
'binddn'=>'isdbwdom\nithinr', //'cn=nithinr,ou=users,dc=isdbwdom,dc=local', | |
'bindpw'=>'gorillacheese', | |
'basedn'=>'dc=isdbwdom,dc=local', | |
'host'=>'isdbwdom.local' | |
); | |
$ldap = Net_LDAP2::connect($cfg); | |
if (PEAR::isError($ldap)) { | |
die('Could not connect to LDAP-server: '.$ldap->getMessage()); | |
} else { | |
echo 'Connect OK'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment