Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 309
  • Last Modified:

AD Authentication using LDAP inside PHP

We have a contractor who is developing a database system for us and he is having issues authenticating to Active Directory using LDAP inside PHP. Can anyone tell me what the syntax is and what information is needed? he sent me this link.

http://us3.php.net/manual/en/function.ldap-bind.php
0
mhmservices
Asked:
mhmservices
1 Solution
 
mhmservicesAuthor Commented:
Here is the code the contractor is using


    var $ldap = array(
        'driver'   => 'ldap',
        'host'     => 'mhmdc1',
        //'login'    => 'gemadmin',
//        'login'    => 'cn=gemadmin,dc=mhmnet',                    
        'login' => 'cn=gemadmin,dc=mhmnet,dc=mhm-services,dc=local',
//        'login' => 'cn=username,dc=mhmnet,dc=mhm-services,dc=local',
//        'login' => 'CN=Username,OU=IT,OU=MHM Users,DC=mhmnet,DC=local',
        'password' => 'Gem@dmin',
        //'database' => 'test_database_name'
    );



other information
domain- mhmnet
user- gemadmin
0
 
Chris DentPowerShell DeveloperCommented:

> 'login' => 'cn=gemadmin,dc=mhmnet,dc=mhm-services,dc=local',

That's the full path to the user, here it suggests the user account has been created in the root of your domain.

If the user was in the Users container that would change to:

'login' => 'cn=gemadmin,cn=users,dc=mhmnet,dc=mhm-services,dc=local',

Or if the user was in an OU you created it would be:

'login' => 'cn=gemadmin,ou=somewhere,ou=anotherou,dc=mhmnet,dc=mhm-services,dc=local',

Chris
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now