grpc::GoogleDefaultCredentials() with a specific credential file path (C++)

173 views
Skip to first unread message

eem...@gmail.com

unread,
Apr 17, 2019, 7:11:42 AM4/17/19
to grpc.io
Hi,

Is there a way (with C++) to use GoogleDefaultCredentials without using the GOOGLE_APPLICATION_CREDENTIALS env var, but using a filepath, or any other method ?

Im trying to create multiple gRPC channels, each one with one diferent credential file. Im doing it now changing by code the previous env var, but it doesnt work well.


P.D: seems like other languages, like Go, allow this posibility:

   perRPC, _ := oauth.NewServiceAccountFromFile("service-account.json", scope)


Thanks!
Message has been deleted

eem...@gmail.com

unread,
Apr 17, 2019, 1:07:51 PM4/17/19
to grpc.io
Solved, using:

grpc::SslCredentials()
grpc::ServiceAccountJWTAccessCredentials()
grpc::CompositeChannelCredentials()

A composite credential can be done using the JSON data loaded from file.

thanks.
Reply all
Reply to author
Forward
0 new messages