src/Identifier/LdapIdentifier.php
protected function _bindUser($username, $password)
    {
        $config = $this->getConfig();
        try {
            $ldapBind = $this->_ldap->bind($config['bindDN']($username), $password);
            if ($ldapBind === true) {
                $this->_ldap->unbind();

                return new ArrayObject([
                    $config['fields'][self::CREDENTIAL_USERNAME] => $username
                ]);
            }
        } catch (ErrorException $e) {
            $this->_handleLdapError($e->getMessage());
        }
        $this->_ldap->unbind();

        return null;
    }
protected function _bindUser($username, $password)
    {
        $config = $this->getConfig();
        try {
            $ldapBind = $this->_ldap->bind($config['bindDN']($username), $password);
            if ($ldapBind === true) {
                $this->_ldap->unbind();

                return new ArrayObject([
                    $config['fields'][self::CREDENTIAL_USERNAME] => $username
                ]);
            }
        } catch (ErrorException $e) {
            $this->_handleLdapError($e->getMessage());
        }
        $this->_ldap->unbind();

        return null;
    }
protected function _bindUser ( $ username , $ password ) { $ config = $ this -> getConfig ( ) ; try { $ ldapBind = $ this -> _ldap -> bind ( $ config [ 'bindDN' ] ( $ username ) , $ password ) ; if ( $ ldapBind === true ) { $ this -> _ldap -> unbind ( ) ; return new ArrayObject ( [ $ config [ 'fields' ] [ self :: CREDENTIAL_USERNAME ] => $ username ] ) ; } } catch ( ErrorException $ e ) { $ this -> _handleLdapError ( $ e -> getMessage ( ) ) ; } $ this -> _ldap -> unbind ( ) ; return null ; }
Try to bind the given user to the LDAP server

@param string $username The username
@param string $password The password
@return \ArrayAccess|null
Try to bind the given user to the LDAP server