aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/node/src/credentials.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/node/src/credentials.js')
-rw-r--r--src/node/src/credentials.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/node/src/credentials.js b/src/node/src/credentials.js
index 710ab6d879..1d73723cc0 100644
--- a/src/node/src/credentials.js
+++ b/src/node/src/credentials.js
@@ -98,6 +98,8 @@ exports.createFromMetadataGenerator = function(metadata_generator) {
message = error.message;
if (error.hasOwnProperty('code')) {
code = error.code;
+ } else {
+ code = grpc.status.UNAUTHENTICATED;
}
if (!metadata) {
metadata = new Metadata();
@@ -116,13 +118,16 @@ exports.createFromMetadataGenerator = function(metadata_generator) {
exports.createFromGoogleCredential = function(google_credential) {
return exports.createFromMetadataGenerator(function(auth_context, callback) {
var service_url = auth_context.service_url;
+ console.log('Service URL:', service_url);
google_credential.getRequestMetadata(service_url, function(err, header) {
if (err) {
+ console.log('Auth error:', err);
callback(err);
return;
}
var metadata = new Metadata();
metadata.add('authorization', header.Authorization);
+ console.log(header.Authorization);
callback(null, metadata);
});
});