bool OAuth2CookieValidator::hmacIsValid() const {
  auto& crypto_util = Envoy::Common::Crypto::UtilitySingleton::get();
  const auto hmac_payload = absl::StrCat(host_, expires_, token_, id_token_, refresh_token_);
  const auto pre_encoded_hmac = Hex::encode(crypto_util.getSha256Hmac(secret_, hmac_payload));
  std::string encoded_hmac;
  absl::Base64Escape(pre_encoded_hmac, &encoded_hmac);

  return encoded_hmac == hmac_;
}
bool OAuth2CookieValidator::hmacIsValid() const {
  auto& crypto_util = Envoy::Common::Crypto::UtilitySingleton::get();
  const auto hmac_payload = absl::StrCat(host_, expires_, token_, id_token_, refresh_token_);
  const auto pre_encoded_hmac = Hex::encode(crypto_util.getSha256Hmac(secret_, hmac_payload));
  std::string encoded_hmac;
  absl::Base64Escape(pre_encoded_hmac, &encoded_hmac);

  return encoded_hmac == hmac_;
}