public function loadUserByUsername($username)
    {

        $users = $this->userData->listEntries([$this->usernameField => $username], [$this->usernameField => '='], 0, 1);
        if (count($users) === 0) {
            throw new UsernameNotFoundException();
        }

        $user = $users[0];
        $roles = is_string($this->userRoleIdentifier) ? $this->loadUserRolesViaManyToMany($user) : $this->loadUserRolesViaData($user->get('id'));

        $userObj = new User($this->usernameField, $this->passwordField, $this->saltField, $user, $roles);
        return $userObj;
    }