Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zend Framework 2 LDAP

I would like to use Zend Framework 2 with Doctrine 2 and openLDAP. My goal is to create a persistence for my LDAP. How can I accomplish this in ZF2?

I noticed that we can get objects from LDAP with Zend\Ldap\Node.

Can anyone show me an example of how to make a search from a LDAP and convert the results into nodes and/or maybe into a Collection of Nodes?

I'd like to have objects to work on after the search.

Thanks

like image 646
Kiruchi Avatar asked Nov 13 '22 11:11

Kiruchi


1 Answers

Well, this may come "a little" late, but just to give others pointers on how to do this. I have created a Module called SamLdapUser which runs its authentication against Ldap / AD. A sample configuration is provided.

The persistence layer (user-object in application) is created through a second Module. This Module hooks in to the getIdentity() function of the authentication Service and then queries the database for the user-object. If no object is existing, a new object will be created. You can check the source code for my module SamLdapUserObject, too.

like image 144
Sam Avatar answered Nov 15 '22 12:11

Sam