authentication - PHP authenticating with LDAP -
I am relatively new to PHP and there is even more for LDAP and one page is accessible only to certified users Need to create. / P>
All I'm working on is the following command on the console:
$ ldapsearch -b 'dc = ut, dc = ee' -D 'uid = USER, or = People, Dc = ut, dc = ee '-x -w' password '' UID = User '' 'Details' So far I've successfully used and set ldap_connect That is using this protocol version 3. I've played with ldap_search and ldap_bind, but all attempts are unsuccessful. I think it's starting to be due to the -x and -w option, or LDAP is still really confusing me.
Any sign will be deeper than that!
$ username = 'user'; $ Password = 'passwd'; $ Account_suffix = '@ example.com'; $ Hostname = 'ldap.example.com'; $ Con = ldap_connect (hostname); If (! Is_resource ($ con)) trigger_error ("Unable to connect to $ hostname", E_USER_WARNING); Ldap_set_option ($ con, LDAP_OPT_PROTOCOL_VERSION, 3); Ldap_set_option ($ con, LDAP_OPT_REFERRALS, 0); If (ldap_bind ($ con, $ username. $ Account_suffix, $ password)) {// log in} ldap_close ($ con); To use a secure connection, you can see your post here: - On most codes, my code must be valid.
Comments
Post a Comment