• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LDAP Windows Authentication

#1
Hi Guys i am beginner in Codeigniter

How to Create a login with LDAP Authentication? any help please..
Reply

#2
(08-01-2016, 07:59 AM)xyclode Wrote: Hi Guys i am beginner in Codeigniter

How to Create a login with LDAP Authentication? any help please..

The below is a basic way to do it (on a LAN)

PHP Code:
       $adServer 'domain.something.com'       //replace with your AD server ip/hostname
 
       $ldaprdn $username '@' $adServer //other format $ldaprdn = "DOMAIN\\" . $username;
 
       //Connecting to server
 
       $ldapconn ldap_connect($adServer)
 
               or die(); #connection resource -> always 1

 
       ldap_set_option($ldapconnLDAP_OPT_NETWORK_TIMEOUT5);
 
       ldap_set_option($ldapconnLDAP_OPT_TIMELIMIT30);

 
       //Connect to Server
 
       if ($ldapconn)
 
       {
 
           if ($ldapbind = @ldap_bind($ldapconn$ldaprdn$password))
 
           {
 
               //Succesfull Authentication
 
               return TRUE;
 
           } else
 
           {
 
               //Unsuccesfull Authentication
 
               return FALSE;
 
           }
 
       } else
 
       {
 
           // Could not connect to AD server.
 
           return FALSE;
 
       
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.