protected function getUserUsername()
    {
        $attribute = Resolver::getLdapDiscoveryAttribute();

        $username = $this->user->getFirstAttribute($attribute);

        if (trim($username) == false) {
            throw new UnexpectedValueException(
                "Unable to locate a user without a {$attribute}"
            );
        }

        return $username;
    }