PHPackages                             cisco-systems/directory-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. cisco-systems/directory-bundle

ActiveSymfony-bundle[Authentication &amp; Authorization](/categories/authentication)

cisco-systems/directory-bundle
==============================

Cisco Global VE directory bundle

3.0(9y ago)120MITPHPPHP &gt;=5.3.2

Since Jun 13Pushed 8y ago4 watchersCompare

[ Source](https://github.com/CiscoVE/DirectoryBundle)[ Packagist](https://packagist.org/packages/cisco-systems/directory-bundle)[ RSS](/packages/cisco-systems-directory-bundle/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (1)Versions (9)Used By (0)

Cisco Global VE directory bundle
================================

[](#cisco-global-ve-directory-bundle)

Symfony bundle for accessing Active Directory servers.

### Installation

[](#installation)

Add the bundle to the requirements in your composer.json file:

```
"cisco-systems/directory-bundle": "dev-master"

```

Register the bundle in your AppKernel:

```
public function registerBundles()
{
    $bundles = array(
        // ...
        new CiscoSystems\DirectoryBundle\CiscoSystemsDirectoryBundle(),
        // ...
    );
    // ...
    return $bundles;
}

```

### Configuration

[](#configuration)

Add configuration for the bundle to your config.yml file. You can configure as many directories as you like. A minimal bundle configuration would look like the following:

```
cisco_systems_directory:
    default_directory: main
    directories:
        main:
            servers:
                primary:
                    host: ads1.example.com

```

A more extensive configuration might look like this:

```
cisco_systems_directory:
    default_directory: main
    directories:
        main:
            repository: 'MyProject\\MyBundle\\Directory\\MyDirectoryRepository'
            default_rdn: '%myAppsLdapUsername%'
            default_password: '%myAppsLdapPassword%'
            servers:
                primary:
                    host: ads1.example.com
                secondary:
                    host: ads2.example.com

```

It's generally advisable to put usernames and passwords into your parameters.yml file and reference those parameters as shown.

Note the `repository` key in the configuration example above: this can be used to create custom query repositories in your application level bundles, containing methods tailored to your directory and your application.

If left unconfigured, the default repository provided by this bundle offers a simple `search()` method that should cover most needs. The default repository class is `CiscoSystems\DirectoryBundle\Directory\QueryRepository`.

### Usage

[](#usage)

In your controller you then simply request the query repository for your directory from the service provided by this bundle and call a repository method on it. If you do not provide a parameter for getRepository() it will use the configured default directory.

```
// Example using the configured default directory and the default query repository with the configured Base Distinguished Name for that directory:
$repository = $this->get( 'cisco.ldap' )->getRepository();
$result = $repository->search( $filter );

// Example using the configured default directory and the default query repository, specifying the Base Distinguished Name:
$repository = $this->get( 'cisco.ldap' )->getRepository();
$result = $repository->search( $filter, $baseDn );

// Example using a specific directory and a custom query repository:
$repository = $this->get( 'cisco.ldap' )->getRepository( 'main' );
$result = $repository->myCustomRepositoryMethod( $parameter, $anotherParameter );

```

### Custom query repositories

[](#custom-query-repositories)

If you need more than the basic `search()` method provided by the default repository, you can define your own query repositories in your application-level bundles. Simply extend the default repository and use the `repository` key as shown in the configuration example above to let the `cisco.ldap` service know what class it needs to instantiate.

When writing your custom repository methods, and you need to do something that the `search()` method of the default repository class cannot cover, use the default repository's `$link` property for PHP's `ldap_*` functions.

### Performing an LDAP bind with a specific RDN and password

[](#performing-an-ldap-bind-with-a-specific-rdn-and-password)

If you do not configure a default RDN and password, or if you want to use different ones in your code somewhere, you can do that in two ways.

1. Specify the configured directory name when calling `getRepository()`, and add the RDN and password as further parameters:

    $repository = $this-&gt;get( 'cisco.ldap' )-&gt;getRepository( 'main', $bindRdn, $bindPassword );
2. Or, if you want to re-bind your application to an already connected directory, use the repository's `bind()` method for binding to a specific RDN and password combination:

    $repository-&gt;bind( $bindRdn, $bindPassword );

That's all.

If you do not want to configure a default RDN and password but still don't want to specify the RDN and password every time you have to perform a bind because it will always the username and password of the currently logged on user, you can set the `bind_authenticated_user` variable for that directory in your bundle configuration to `true`.

Even if you do that you can still perform an anonymous bind by using the fourth parameter of the `getRepository()` method and set it to `false`:

```
$repository = $this->get( 'cisco.ldap' )->getRepository( 'main', '', '', false );

```

### Authentication

[](#authentication)

You can also use this bundle to authenticate your users against a directory. For this purpose the bundle provides a simple form authenticator service. To use this service implement a `simple_form` login as described in the [Symfony Cookbook article on custom authenticators](symfony.com/doc/current/cookbook/security/custom_password_authenticator.html).

Note that in this case you do not need to specify an encoder in your `security.yml` file, as the password validation is handled by the directory you're authenticating against.

An example security configuration might look like this:

```
security:
    providers:
        ldap:
            id: cisco.ldap.userprovider
    firewalls:
        main:
            pattern: ^/
            anonymous:  true
            simple_form:
                authenticator: cisco.ldap.authenticator
                check_path:    CiscoSystemsDirectoryBundle_logincheck
                login_path:    CiscoSystemsDirectoryBundle_login
            logout:
                invalidate_session: true

```

If you need to do more with your User objects than simply authenticating them, extend the user provider from this bundle and replace it in the above example.

Don't forget to import the routing for this bundle in your main `routing.yml` file:

```
ldap:
    resource: "@CiscoSystemsDirectoryBundle/Controller"
    type:     annotation

```

You will likely also want to override the login template.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 89.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~413 days

Total

4

Last Release

3160d ago

Major Versions

v1.0 → 2.82016-01-13

2.8 → 3.02016-08-16

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/236844?v=4)[Moritz Kraft](/maintainers/userfriendly)[@userfriendly](https://github.com/userfriendly)

---

Top Contributors

[![userfriendly](https://avatars.githubusercontent.com/u/236844?v=4)](https://github.com/userfriendly "userfriendly (67 commits)")[![mokraftcisco](https://avatars.githubusercontent.com/u/113981572?v=4)](https://github.com/mokraftcisco "mokraftcisco (6 commits)")[![awolder](https://avatars.githubusercontent.com/u/3007797?v=4)](https://github.com/awolder "awolder (2 commits)")

---

Tags

Authenticationloginldapactive directory

### Embed Badge

![Health badge](/badges/cisco-systems-directory-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/cisco-systems-directory-bundle/health.svg)](https://phpackages.com/packages/cisco-systems-directory-bundle)
```

###  Alternatives

[auth0/auth0-php

PHP SDK for Auth0 Authentication and Management APIs.

40921.3M85](/packages/auth0-auth0-php)[auth0/login

Auth0 Laravel SDK. Straight-forward and tested methods for implementing authentication, and accessing Auth0's Management API endpoints.

2745.2M3](/packages/auth0-login)[delight-im/auth

Authentication for PHP. Simple, lightweight and secure.

1.2k142.4k30](/packages/delight-im-auth)[causal/ig_ldap_sso_auth

This extension provides LDAP support for TYPO3 by delegating the authentication of frontend and/or backend users to the centrally-managed directory of your organization. It fully supports OpenLDAP and Active Directory and is capable of connecting securely to the authentication server using either TLS or SSL (ldaps://). In case of use in an intranet environment, this extension is a perfect match since it natively brings Single Sign-On (SSO) capability to TYPO3 without any complex configuration.

32388.0k1](/packages/causal-ig-ldap-sso-auth)[auth0/symfony

Symfony SDK for Auth0 Authentication and Management APIs.

128790.7k](/packages/auth0-symfony)[jotaelesalinas/laravel-adminless-ldap-auth

Authenticate users in Laravel against an adminless LDAP server

2075.2k](/packages/jotaelesalinas-laravel-adminless-ldap-auth)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
