Is it possible to initialise a Google Cloud Storage Client in C++ with an OAuth2 token?
I am unable to provide a credentials file to authenticate to Google Cloud Storage. I was wondering whether it was possible to use the newly added oauth2 library in google-cloud-cpp Client Library to create an OAauth2 token and initialise a storage client?
I have tried the following to create an OAuth token:
auto const expiration = std::chrono::system_clock::now() + std::chrono::minutes(15);
auto credentials = google::cloud::MakeAccessTokenCredentials(access_key, expiration);
auto generator = google::cloud::oauth2::MakeAccessTokenGenerator(*credentials);
auto token = generator->GetToken();
I was wondering if it was possible to initialise a google::cloud::storage::Client() with this access token?
Read more here: Source link
