Security/User/LdapUserProvider.php
public function refreshUser(UserInterface $user)
    {
        if (!$user instanceof LdapUserInterface) {
            throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', get_class($user)));
        }
        $roles = $user->getRoles();

        if ($this->options['refresh_user_attributes']) {
            $user = $this->constructUserClass($this->getLdapUser('guid', $user->getLdapGuid()));
        }
        if ($this->options['refresh_user_roles']) {
            $this->roleMapper->setRoles($user);
        } else {
            $user->setRoles($roles);
        }

        return $user;
    }
public function refreshUser(UserInterface $user)
    {
        if (!$user instanceof LdapUserInterface) {
            throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', get_class($user)));
        }
        $roles = $user->getRoles();

        if ($this->options['refresh_user_attributes']) {
            $user = $this->constructUserClass($this->getLdapUser('guid', $user->getLdapGuid()));
        }
        if ($this->options['refresh_user_roles']) {
            $this->roleMapper->setRoles($user);
        } else {
            $user->setRoles($roles);
        }

        return $user;
    }
{@inheritdoc}