Security/User/LdapUserProvider.php
public function loadUserByUsername($username)
    {
        $this->dispatcher->dispatch(LoadUserEvent::BEFORE, new LoadUserEvent($username, $this->ldap->getDomainContext()));
        $ldapUser = $this->getLdapUser('username', $username);
        $user = $this->constructUserClass($ldapUser);
        $this->roleMapper->setRoles($user);
        $this->dispatcher->dispatch(LoadUserEvent::AFTER, new LoadUserEvent($username, $this->ldap->getDomainContext(), $user, $ldapUser));

        return $user;
    }
public function loadUserByUsername($username)
    {
        $this->dispatcher->dispatch(LoadUserEvent::BEFORE, new LoadUserEvent($username, $this->ldap->getDomainContext()));
        $ldapUser = $this->getLdapUser('username', $username);
        $user = $this->constructUserClass($ldapUser);
        $this->roleMapper->setRoles($user);
        $this->dispatcher->dispatch(LoadUserEvent::AFTER, new LoadUserEvent($username, $this->ldap->getDomainContext(), $user, $ldapUser));

        return $user;
    }
{@inheritdoc}