public function authenticate($passwordProvided, $passwordHash)
    {
        if (password_verify($passwordProvided, $passwordHash)) {
            $this->setAuthenticated(true);

            if ($this->getUser() && property_exists($this->getUser(), $this->getUserIdProperty())) {
                $userId = $this->getUser()->{$this->getUserIdProperty()};
                $this->setAuthenticationData(['user_id' => $userId]);
            }
            $this->writeToSession([
                'authenticated' => true,
                'data'          => $this->getAuthenticationData(),
            ]);
        } else {
            $this->revokeAuthentication();
        }
        return $this->isAuthenticated();
    }