Skip to content

How to authenticate in uncontrolled environment #9958

Answered by coryan
gasgallo asked this question in Q&A
Discussion options

You must be logged in to vote

I am not sure I understand the question, apologies if I missed something.

Presumably the consumers of your library have their own credentials to authenticate with Google Cloud Platform. So much like we do for the libraries in google-cloud-cpp your library would need to have options to set these credentials. How would they do so? Well, that depends on the API you want to expose.

You could expose the google::cloud::Credentials directly to them, so your library could do something like:

namespace my_lib {
  class Client; // defined elsewhere.

  Client MakeClient(std::shared_ptr<google::cloud::Credentials> credentials) {
    auto options = google::cloud::Options{}.set<google::cloud::UnifiedCr…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@gasgallo
Comment options

@coryan
Comment options

@gasgallo
Comment options

Answer selected by gasgallo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants