Skip to content

Commit

Permalink
dont use httplib for now
Browse files Browse the repository at this point in the history
  • Loading branch information
archiewood committed Nov 20, 2024
1 parent ef43c38 commit 3a4642e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9,395 deletions.
2 changes: 1 addition & 1 deletion duckdb
Submodule duckdb updated 480 files
12 changes: 5 additions & 7 deletions src/gsheets_get_token.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <httplib.hpp>

#include <json.hpp>
using json = nlohmann::json;
Expand Down Expand Up @@ -119,12 +118,11 @@ namespace duckdb
char jwt[1024];
sprintf(jwt, "%s.%s", input, signature_64);

duckdb_httplib_openssl::Client cli("https://oauth2.googleapis.com");
duckdb_httplib_openssl::Params params;
params.emplace("grant_type", "urn:ietf:params:oauth:grant-type:jwt-bearer");
params.emplace("assertion", jwt);
auto result = cli.Post("/token", params);
return (result -> body);
std::string body = "grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=" + std::string(jwt);
return perform_https_request("oauth2.googleapis.com", "/token", "",
HttpMethod::POST,
body,
"application/x-www-form-urlencoded");
} else {
printf("Could not verify RSA signature.");
}
Expand Down
Loading

0 comments on commit 3a4642e

Please sign in to comment.