surda/adldap2-nette

Adldap2 integration into Nette Framework

v1.0.0 2019-01-23 21:31 UTC

README

Adldap2 integration into Nette Framework.

Installation

The recommended way to is via Composer:

composer require surda/adldap2-nette

After that you have to register extension in config.neon:

extensions:
    adldap: Surda\Adldap\DI\AdldapExtension

Minimal configuration

adldap:
    hosts: { 'corp-dc1.corp.acme.org', 'corp-dc2.corp.acme.org' }
    base_dn: 'dc=corp,dc=acme,dc=org'
    username: 'admin'
    password: 'password'

List of all configuration options:

adldap:
    # Mandatory configuration options
    hosts: { 'corp-dc1.corp.acme.org', 'corp-dc2.corp.acme.org' }
    base_dn: 'dc=corp,dc=acme,dc=org'
    username: 'admin'
    password: 'password'

    # Optional configuration options
    schema: \Adldap\Schemas\ActiveDirectory
    account_prefix: 'ACME-'
    account_suffix: '@@acme.org'
    port: 389
    follow_referrals: FALSE
    use_ssl: false
    use_tls: false
    version: 3
    timeout: 5

Usage

use Adldap\Adldap;

class Foo
{
    /** @var Adldap */
    private $adldap;

    /**
     * @param Adldap $adldap
     */
    public function __construct(Adldap $adldap)
    {
        $this->adldap = $adldap;
    }

    public function bar()
    {
        $provider = $this->adldap->connect();
        // ...
    }
}

More in the Adldap2 documentation.