{"id":45094265,"url":"https://github.com/appserver-io/ldap","last_synced_at":"2026-02-19T18:09:41.775Z","repository":{"id":56949573,"uuid":"187212288","full_name":"appserver-io/ldap","owner":"appserver-io","description":"LDAP integration for PHP application server","archived":false,"fork":false,"pushed_at":"2019-06-22T10:23:24.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-24T23:32:42.285Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appserver-io.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-17T12:27:03.000Z","updated_at":"2019-06-22T10:23:26.000Z","dependencies_parsed_at":"2022-08-21T07:50:20.212Z","dependency_job_id":null,"html_url":"https://github.com/appserver-io/ldap","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/appserver-io/ldap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appserver-io%2Fldap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appserver-io%2Fldap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appserver-io%2Fldap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appserver-io%2Fldap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appserver-io","download_url":"https://codeload.github.com/appserver-io/ldap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appserver-io%2Fldap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29626892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T18:02:07.722Z","status":"ssl_error","status_checked_at":"2026-02-19T18:01:46.144Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-19T18:09:41.111Z","updated_at":"2026-02-19T18:09:41.770Z","avatar_url":"https://github.com/appserver-io.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# appserver.io LDAP\n\nThis is a basic LDAP integration that provides a Doctrine ORM like functionality for LDAP handling.\n\n## Data Source\n\nTo define a Data Source, simply add a XML file with a following structure to your application's `META-INF` directory\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cdatasources xmlns=\"http://www.appserver.io/appserver\"\u003e\n    \u003cdatasource name=\"my-ldap-ds\"\u003e\n        \u003cdatabase\u003e\n            \u003cdriver\u003eext_ldap\u003c/driver\u003e\n            \u003cuser\u003ecn=admin,dc=example,dc=org\u003c/user\u003e\n            \u003cpassword\u003eadmin\u003c/password\u003e\n            \u003cdatabaseName\u003edc=example,dc=org\u003c/databaseName\u003e\n            \u003cdatabaseHost\u003e127.0.0.1\u003c/databaseHost\u003e\n            \u003cdatabasePort\u003e389\u003c/databasePort\u003e\n        \u003c/database\u003e\n    \u003c/datasource\u003e\n\u003c/datasources\u003e\n```\n\n## Persistence Manager\n\nConfigure the Persistence Manager in `META-INF/persistence.xml` like \n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cpersistence xmlns=\"http://www.appserver.io/appserver\"\u003e\n    \u003cpersistenceUnits\u003e\n        \u003cpersistenceUnit\n            name=\"MyLdapEntityManager\"\n            interface=\"AppserverIo\\Appserver\\Ldap\\EntityManagerInterface\"\n            type=\"AppserverIo\\Appserver\\Ldap\\EntityManager\"\n            factory=\"AppserverIo\\Appserver\\Ldap\\EntityManagerFactory\"\u003e\n            \u003cdatasource name=\"my-ldap-ds\"/\u003e\n        \u003c/persistenceUnit\u003e\n    \u003c/persistenceUnits\u003e\n\u003c/persistence\u003e\n```\n\n## Inject the Persistence Manager\n\nThe LDAP Persistence Manager can then be injected as a Doctrine Entity Manager, e. g.\n\n```php\n\n/**\n * TechDivision\\Project\\Repositories\\Ldap\\RoleRepositoryInterface\n */\n\nnamespace AppserverIo\\MyProject;\n\n/**\n * Dummy implementation of a LDAP repository.\n */\nclass DummyRepository\n{\n\n    /**\n     * The Symfony LDAP adapter instance.\n     *\n     * @var \\AppserverIo\\Appserver\\PersistenceContainer\\Doctrine\\DoctrineEntityManagerProxy\n     * @EPB\\PersistenceUnit(unitName=\"MyLdapEntityManager\")\n     */\n    protected $ldapEntityManager;\n}\n```\n\n## Persistence Manager Interface\n\nThe LDAP Persistence Manager provides the following interface which gives you access to your LDAP.\n\n\u003e ATTENTION: In version 2.x `persist()` and `remove()` methods has not yet been implemented.\n\n```php\n\n/**\n * AppserverIo\\Ldap\\EntityManagerInterface\n *\n * NOTICE OF LICENSE\n *\n * This source file is subject to the Open Software License (OSL 3.0)\n * that is available through the world-wide-web at this URL:\n * http://opensource.org/licenses/osl-3.0.php\n *\n * PHP version 5\n *\n * @author    Tim Wagner \u003ctw@appserver.io\u003e\n * @copyright 2015 TechDivision GmbH \u003cinfo@appserver.io\u003e\n * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)\n * @link      https://github.com/appserver-io/ldap\n * @link      http://www.appserver.io\n */\n\nnamespace AppserverIo\\Ldap;\n\n/**\n * The interface for all LDAP Entity Manager implementations.\n *\n * @author    Tim Wagner \u003ctw@appserver.io\u003e\n * @copyright 2015 TechDivision GmbH \u003cinfo@appserver.io\u003e\n * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)\n * @link      https://github.com/appserver-io/ldap\n * @link      http://www.appserver.io\n */\ninterface EntityManagerInterface\n{\n\n    /**\n     * Returns the LDAP client instance.\n     *\n     * @return \\AppserverIo\\Ldap\\LdapClientInterface The LDAP client instance\n     */\n    public function getLdapClient();\n\n    /**\n     * Returns the persistence unit configuration instance.\n     *\n     * @return \\AppserverIo\\Description\\Configuration\\PersistenceUnitConfigurationInterface The configuration instance\n     */\n    public function getConfiguration();\n\n    /**\n     * Returns the base DN =\u003e database in datasource configuration.\n     *\n     * @return string The base DN\n     */\n    public function getBaseDn();\n\n    /**\n     * Returns the repository instance for the entity with the passed lookup name.\n     *\n     * @param string $lookupName The lookup name of the entity to return the repository for\n     *\n     * @return object The LDAP repository instance\n     */\n    public function getRepository($lookupName);\n\n    /**\n     * Finds an entity by its lookup name.\n     *\n     * @param string $lookupName The look name of the entity to find\n     * @param mixed  $id         The identity of the entity to find\n     *\n     * @return object|null The entity instance or NULL if the entity can not be found.\n     *\n     * @throws \\Exception\n     */\n    public function find($lookupName, $id);\n\n    /**\n     * Tells the EntityManager to make an instance managed and persistent.\n     *\n     * The entity will be entered into the database at or before transaction\n     * commit or as a result of the flush operation.\n     *\n     * NOTE: The persist operation always considers entities that are not yet known to\n     * this EntityManager as NEW. Do not pass detached entities to the persist operation.\n     *\n     * @param object $entity The instance to make managed and persistent\n     *\n     * @return void\n     * @throws \\Exception\n     */\n    public function persist($entity);\n\n    /**\n     * Removes an entity instance.\n     *\n     * A removed entity will be removed from the database at or before transaction commit\n     * or as a result of the flush operation.\n     *\n     * @param object $entity The entity instance to remove\n     *\n     * @return void\n     * @throws \\Exception\n     */\n    public function remove($entity);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappserver-io%2Fldap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappserver-io%2Fldap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappserver-io%2Fldap/lists"}