diff options
Diffstat (limited to 'src/cpp/client')
-rw-r--r-- | src/cpp/client/client_context.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cpp/client/client_context.cc b/src/cpp/client/client_context.cc index 72cdd49d19..c68f6dd9f8 100644 --- a/src/cpp/client/client_context.cc +++ b/src/cpp/client/client_context.cc @@ -36,6 +36,7 @@ #include <grpc/grpc.h> #include <grpc++/credentials.h> #include <grpc++/time.h> +#include "src/cpp/common/create_auth_context.h" namespace grpc { @@ -75,6 +76,13 @@ void ClientContext::set_call(grpc_call* call, } } +std::shared_ptr<const AuthContext> ClientContext::auth_context() const { + if (auth_context_.get() == nullptr) { + auth_context_ = CreateAuthContext(call_); + } + return auth_context_; +} + void ClientContext::TryCancel() { if (call_) { grpc_call_cancel(call_); |