aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp/client
diff options
context:
space:
mode:
authorGravatar Yang Gao <yangg@google.com>2015-07-08 21:48:46 -0700
committerGravatar Yang Gao <yangg@google.com>2015-07-08 21:48:46 -0700
commitec5a0ba6bacecc63297edc4bede47d1bd364daf8 (patch)
tree78042d769e04c6b0ec14fb5cd0e89572789d805a /src/cpp/client
parent19512b1febcdd7d4a947dfcafeb58e51e64ee609 (diff)
parenta6b9a891a0bc27ed1adb7460ec0c3edf2191a884 (diff)
Merge pull request #2271 from jboeuf/oauth2_access_token
Adding support for raw access token credentials.
Diffstat (limited to 'src/cpp/client')
-rw-r--r--src/cpp/client/secure_credentials.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc
index b5134b3140..4d200908fb 100644
--- a/src/cpp/client/secure_credentials.cc
+++ b/src/cpp/client/secure_credentials.cc
@@ -117,6 +117,13 @@ std::shared_ptr<Credentials> RefreshTokenCredentials(
grpc_refresh_token_credentials_create(json_refresh_token.c_str()));
}
+// Builds access token credentials.
+std::shared_ptr<Credentials> AccessTokenCredentials(
+ const grpc::string& access_token) {
+ return WrapCredentials(
+ grpc_access_token_credentials_create(access_token.c_str()));
+}
+
// Builds IAM credentials.
std::shared_ptr<Credentials> IAMCredentials(
const grpc::string& authorization_token,