code: public function isEqualTo(UserInterface $user)
      {
          if (!$user instanceof SamlUser) {
              return false;
          }
  
          if ($this->getSalt() !== $user->getSalt()) {
              return false;
          }
  
          if ($this->username !== $user->getUsername()) {
              return false;
          }
  
          return true;
      }
docs: Verify if user is equalt to $user.
  
  @param UserInterface $user  User interface