{"action":"created","issue":{"url":"https://api.github.com/repos/google/google-api-nodejs-client/issues/373","labels_url":"https://api.github.com/repos/google/google-api-nodejs-client/issues/373/labels{/name}","comments_url":"https://api.github.com/repos/google/google-api-nodejs-client/issues/373/comments","events_url":"https://api.github.com/repos/google/google-api-nodejs-client/issues/373/events","html_url":"https://github.com/google/google-api-nodejs-client/issues/373","id":58328297,"number":373,"title":"Code breaking while authenticating","user":{"login":"VikramTiwari","id":1330677,"avatar_url":"https://avatars.githubusercontent.com/u/1330677?v=3","gravatar_id":"","url":"https://api.github.com/users/VikramTiwari","html_url":"https://github.com/VikramTiwari","followers_url":"https://api.github.com/users/VikramTiwari/followers","following_url":"https://api.github.com/users/VikramTiwari/following{/other_user}","gists_url":"https://api.github.com/users/VikramTiwari/gists{/gist_id}","starred_url":"https://api.github.com/users/VikramTiwari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VikramTiwari/subscriptions","organizations_url":"https://api.github.com/users/VikramTiwari/orgs","repos_url":"https://api.github.com/users/VikramTiwari/repos","events_url":"https://api.github.com/users/VikramTiwari/events{/privacy}","received_events_url":"https://api.github.com/users/VikramTiwari/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-20T09:37:47Z","updated_at":"2015-03-25T09:28:12Z","closed_at":null,"body":"I am connecting to big query using JWT client. My application is high scale and makes this connection every time it wants to stream data into big query.\r\n\r\nAny possible fix to this?\r\n\r\nRaw error log;\r\n```\r\ncrypto.js:398\r\n  var ret = this._binding.sign(toBuf(key));\r\n                          ^\r\nTypeError: Not a buffer\r\n    at Sign.sign (crypto.js:398:27)\r\n    at createRS256Signature (/home/ubuntu/vikram/test/shock/node_modules/googleapis/node_modules/gapitoken/node_modules/jws/index.js:75:58)\r\n    at jwsRS256Sign (/home/ubuntu/vikram/test/shock/node_modules/googleapis/node_modules/gapitoken/node_modules/jws/index.js:68:21)\r\n    at Object.jwsSign [as sign] (/home/ubuntu/vikram/test/shock/node_modules/googleapis/node_modules/gapitoken/node_modules/jws/index.js:32:12)\r\n    at GAPI.getAccessToken (/home/ubuntu/vikram/test/shock/node_modules/googleapis/node_modules/gapitoken/gapitoken.js:56:25)\r\n    at GAPI.getToken (/home/ubuntu/vikram/test/shock/node_modules/googleapis/node_modules/gapitoken/gapitoken.js:35:14)\r\n    at JWT.refreshToken_ (/home/ubuntu/vikram/test/shock/node_modules/googleapis/lib/auth/jwtclient.js:89:13)\r\n    at /home/ubuntu/vikram/test/shock/node_modules/googleapis/lib/auth/jwtclient.js:68:12\r\n    at /home/ubuntu/vikram/test/shock/node_modules/googleapis/node_modules/gapitoken/gapitoken.js:20:17\r\n    at fs.js:266:14\r\n```"},"comment":{"url":"https://api.github.com/repos/google/google-api-nodejs-client/issues/comments/85952024","html_url":"https://github.com/google/google-api-nodejs-client/issues/373#issuecomment-85952024","issue_url":"https://api.github.com/repos/google/google-api-nodejs-client/issues/373","id":85952024,"user":{"login":"vivekkrbajpai","id":3265806,"avatar_url":"https://avatars.githubusercontent.com/u/3265806?v=3","gravatar_id":"","url":"https://api.github.com/users/vivekkrbajpai","html_url":"https://github.com/vivekkrbajpai","followers_url":"https://api.github.com/users/vivekkrbajpai/followers","following_url":"https://api.github.com/users/vivekkrbajpai/following{/other_user}","gists_url":"https://api.github.com/users/vivekkrbajpai/gists{/gist_id}","starred_url":"https://api.github.com/users/vivekkrbajpai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vivekkrbajpai/subscriptions","organizations_url":"https://api.github.com/users/vivekkrbajpai/orgs","repos_url":"https://api.github.com/users/vivekkrbajpai/repos","events_url":"https://api.github.com/users/vivekkrbajpai/events{/privacy}","received_events_url":"https://api.github.com/users/vivekkrbajpai/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T09:28:12Z","updated_at":"2015-03-25T09:28:12Z","body":"     function InstertStreamInBQ(dataObj, tableName, callback){\r\n    \t // get authentication\r\n        jwtClient.authorize(function(err, tokens) {\r\n            if (err) {\r\n                console.log(err);\r\n                return;\r\n            }\r\n\r\n            // request body for big query\r\n            var request_body = {\r\n                \"kind\": \"bigquery#tableDataInsertAllRequest\",\r\n                \"rows\": [{\r\n                    \"insertId\": dataObj.uuid,\r\n                    \"json\": dataObj\r\n                }]\r\n            }\r\n\r\n            // save the data in big query's table\r\n            bq.tabledata.insertAll({\r\n                auth: jwtClient,\r\n                datasetId: config.datasetId,\r\n                projectId: config.projectId,\r\n                tableId: tableName,\r\n                resource: request_body\r\n            }, function(err, resp) {\r\n               \tif(err){\r\n                    callback(err, null);\r\n                    console.log(\"Error in bigquery stream save data @ bigquery.js : tableName \", err)\r\n               \t}else{\r\n               \t     callback(null, resp);\r\n            });\r\n          }\r\nThis is the sample code I am using to stream data in bigquery and getting the same error during the load as described by @VikramTiwari.\r\nCould you pls suggest a way to overcome it.\r\n"}}