{"_id":"gapitoken","_rev":"293473","name":"gapitoken","description":"Node.js module for Google API service account authorization (Server to Server flow)","dist-tags":{"latest":"0.1.5"},"maintainers":[{"name":"bsphere","email":"gbenhaim@gmail.com"}],"time":{"modified":"2021-06-03T18:54:07.000Z","created":"2013-01-28T21:34:02.961Z","0.1.5":"2015-07-29T07:23:52.127Z","0.1.4":"2015-04-07T13:49:26.384Z","0.1.3":"2014-03-23T09:47:10.222Z","0.1.2":"2014-03-19T19:17:59.460Z","0.1.1":"2014-03-19T19:13:20.322Z","0.1.0":"2013-08-20T09:31:05.378Z","0.0.3":"2013-06-16T06:40:10.152Z","0.0.2":"2013-03-15T07:17:49.361Z","0.0.1":"2013-01-28T21:34:02.961Z"},"users":{},"author":{"name":"Gal Ben-Haim"},"repository":{"type":"git","url":"git://github.com/bsphere/node-gapitoken.git"},"versions":{"0.1.5":{"name":"gapitoken","version":"0.1.5","description":"Node.js module for Google API service account authorization (Server to Server flow)","main":"gapitoken.js","repository":{"type":"git","url":"git://github.com/bsphere/node-gapitoken.git"},"keywords":["jwt","jws","google","api","token","service"],"author":{"name":"Gal Ben-Haim"},"license":"MIT","dependencies":{"jws":"~3.0.0","request":"^2.54.0"},"devDependencies":{"mocha":"^2.2.5"},"scripts":{"test":"mocha test"},"gitHead":"d37c44d90b7b212ddc5fa74f3daa3e8a13583ca9","bugs":{"url":"https://github.com/bsphere/node-gapitoken/issues"},"homepage":"https://github.com/bsphere/node-gapitoken","_id":"gapitoken@0.1.5","_shasum":"3577fcfb5426be3a7b8ebada92671229d8cc81ce","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"bsphere","email":"gbenhaim@gmail.com"},"maintainers":[{"name":"bsphere","email":"gbenhaim@gmail.com"}],"dist":{"shasum":"3577fcfb5426be3a7b8ebada92671229d8cc81ce","size":3793,"noattachment":false,"key":"/gapitoken/-/gapitoken-0.1.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/gapitoken/download/gapitoken-0.1.5.tgz"},"directories":{},"publish_time":1438154632127,"_cnpm_publish_time":1438154632127,"_hasShrinkwrap":false},"0.1.4":{"name":"gapitoken","version":"0.1.4","description":"Node.js module for Google API service account authorization (Server to Server flow)","main":"gapitoken.js","repository":{"type":"git","url":"git://github.com/bsphere/node-gapitoken.git"},"keywords":["jwt","jws","google","api","token","service"],"author":{"name":"Gal Ben-Haim"},"license":"MIT","dependencies":{"jws":"0.0.2","request":"^2.54.0"},"gitHead":"85db3398a4848a2513485a50742ffcd0b5601e09","bugs":{"url":"https://github.com/bsphere/node-gapitoken/issues"},"homepage":"https://github.com/bsphere/node-gapitoken","_id":"gapitoken@0.1.4","scripts":{},"_shasum":"643dedb26cb142466f62b73d2782e7822a6f1ad8","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"bsphere","email":"gbenhaim@gmail.com"},"maintainers":[{"name":"bsphere","email":"gbenhaim@gmail.com"}],"dist":{"shasum":"643dedb26cb142466f62b73d2782e7822a6f1ad8","size":1897,"noattachment":false,"key":"/gapitoken/-/gapitoken-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/gapitoken/download/gapitoken-0.1.4.tgz"},"directories":{},"publish_time":1428414566384,"_cnpm_publish_time":1428414566384,"_hasShrinkwrap":false},"0.1.3":{"name":"gapitoken","version":"0.1.3","description":"Node.js module for Google API service account authorization (Server to Server flow)","main":"gapitoken.js","repository":{"type":"git","url":"git://github.com/bsphere/node-gapitoken.git"},"keywords":["jwt","jws","google","api","token","service"],"author":{"name":"Gal Ben-Haim"},"license":"MIT","dependencies":{"jws":"0.0.2"},"bugs":{"url":"https://github.com/bsphere/node-gapitoken/issues"},"homepage":"https://github.com/bsphere/node-gapitoken","_id":"gapitoken@0.1.3","dist":{"shasum":"b873f1172603d043f930a71a0a4846330f385b41","size":1966,"noattachment":false,"key":"/gapitoken/-/gapitoken-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/gapitoken/download/gapitoken-0.1.3.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"bsphere","email":"gbenhaim@gmail.com"},"maintainers":[{"name":"bsphere","email":"gbenhaim@gmail.com"}],"directories":{},"publish_time":1395568030222,"_cnpm_publish_time":1395568030222,"_hasShrinkwrap":false},"0.1.2":{"name":"gapitoken","version":"0.1.2","description":"Node.js module for Google API service account authorization (Server to Server flow)","main":"gapitoken.js","repository":{"type":"git","url":"git://github.com/bsphere/node-gapitoken.git"},"keywords":["jwt","jws","google","api","token","service"],"author":{"name":"Gal Ben-Haim"},"license":"MIT","dependencies":{"jws":"0.0.2"},"bugs":{"url":"https://github.com/bsphere/node-gapitoken/issues"},"homepage":"https://github.com/bsphere/node-gapitoken","_id":"gapitoken@0.1.2","dist":{"shasum":"5ce4c2ee8e147eb5afb1c0beed119a664067a4e8","size":1954,"noattachment":false,"key":"/gapitoken/-/gapitoken-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/gapitoken/download/gapitoken-0.1.2.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"bsphere","email":"gbenhaim@gmail.com"},"maintainers":[{"name":"bsphere","email":"gbenhaim@gmail.com"}],"directories":{},"publish_time":1395256679460,"_cnpm_publish_time":1395256679460,"_hasShrinkwrap":false},"0.1.1":{"name":"gapitoken","version":"0.1.1","description":"Node.js module for Google API service account authorization (Server to Server flow)","main":"gapitoken.js","repository":{"type":"git","url":"git://github.com/bsphere/node-gapitoken.git"},"keywords":["jwt","jws","google","api","token","service"],"author":{"name":"Gal Ben-Haim"},"license":"MIT","dependencies":{"jws":"0.0.2"},"bugs":{"url":"https://github.com/bsphere/node-gapitoken/issues"},"homepage":"https://github.com/bsphere/node-gapitoken","_id":"gapitoken@0.1.1","dist":{"shasum":"a559436ecb1f329d38f5775aa8712872c3215db1","size":1925,"noattachment":false,"key":"/gapitoken/-/gapitoken-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/gapitoken/download/gapitoken-0.1.1.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"bsphere","email":"gbenhaim@gmail.com"},"maintainers":[{"name":"bsphere","email":"gbenhaim@gmail.com"}],"directories":{},"publish_time":1395256400322,"_cnpm_publish_time":1395256400322,"_hasShrinkwrap":false},"0.1.0":{"name":"gapitoken","version":"0.1.0","description":"Node.js module for Google API service account authorization (Server to Server flow)","main":"gapitoken.js","repository":{"type":"git","url":"git://github.com/bsphere/node-gapitoken.git"},"keywords":["jwt","jws","google","api","token","service"],"author":{"name":"Gal Ben-Haim"},"license":"MIT","readmeFilename":"README.md","dependencies":{"jws":"0.0.2"},"bugs":{"url":"https://github.com/bsphere/node-gapitoken/issues"},"_id":"gapitoken@0.1.0","dist":{"shasum":"7f179092efc2bd65cd2c1cfb9561866d9d529781","size":1897,"noattachment":false,"key":"/gapitoken/-/gapitoken-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/gapitoken/download/gapitoken-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"bsphere","email":"gbenhaim@gmail.com"},"maintainers":[{"name":"bsphere","email":"gbenhaim@gmail.com"}],"directories":{},"publish_time":1376991065378,"_cnpm_publish_time":1376991065378,"_hasShrinkwrap":false},"0.0.3":{"name":"gapitoken","version":"0.0.3","description":"Node.js module for Google API service account authorization (Server to Server flow)","main":"gapitoken.js","repository":{"type":"git","url":"git://github.com/bsphere/node-gapitoken.git"},"keywords":["jwt","jws","google","api","token","service"],"author":{"name":"Gal Ben-Haim"},"license":"MIT","readmeFilename":"README.md","dependencies":{"jws":"0.0.2"},"_id":"gapitoken@0.0.3","dist":{"shasum":"7e2613e0bed1ba6069e5ba1532cf67ee0576871b","size":1716,"noattachment":false,"key":"/gapitoken/-/gapitoken-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/gapitoken/download/gapitoken-0.0.3.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"bsphere","email":"gbenhaim@gmail.com"},"maintainers":[{"name":"bsphere","email":"gbenhaim@gmail.com"}],"directories":{},"publish_time":1371364810152,"_cnpm_publish_time":1371364810152,"_hasShrinkwrap":false},"0.0.2":{"name":"gapitoken","version":"0.0.2","description":"Node.js module for Google API service account authorization (Server to Server flow)","main":"gapitoken.js","repository":{"type":"git","url":"git://github.com/bsphere/node-gapitoken.git"},"keywords":["jwt","jws","google","api","token","service"],"author":{"name":"Gal Ben-Haim"},"license":"MIT","readmeFilename":"README.md","dependencies":{"jws":"0.0.2"},"_id":"gapitoken@0.0.2","dist":{"shasum":"97c68b4c64886ab7961dc08a109ce2f4ee76c4be","size":1703,"noattachment":false,"key":"/gapitoken/-/gapitoken-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/gapitoken/download/gapitoken-0.0.2.tgz"},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"bsphere","email":"gbenhaim@gmail.com"},"maintainers":[{"name":"bsphere","email":"gbenhaim@gmail.com"}],"directories":{},"publish_time":1363331869361,"_cnpm_publish_time":1363331869361,"_hasShrinkwrap":false},"0.0.1":{"name":"gapitoken","version":"0.0.1","description":"Node.js module for Google API service account authorization (Server to Server flow)","main":"gapitoken.js","repository":{"type":"git","url":"git://github.com/bsphere/node-gapitoken.git"},"keywords":["jwt","jws","google","api","token","service"],"author":{"name":"Gal Ben-Haim"},"license":"MIT","readmeFilename":"README.md","dependencies":{"jws":"0.0.2"},"_id":"gapitoken@0.0.1","dist":{"shasum":"dc2af12d2eaa9dbcfaa5d4fc55ee352c74d7466d","size":1652,"noattachment":false,"key":"/gapitoken/-/gapitoken-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/gapitoken/download/gapitoken-0.0.1.tgz"},"_npmVersion":"1.1.71","_npmUser":{"name":"bsphere","email":"gbenhaim@gmail.com"},"maintainers":[{"name":"bsphere","email":"gbenhaim@gmail.com"}],"directories":{},"publish_time":1359408842961,"_cnpm_publish_time":1359408842961,"_hasShrinkwrap":false}},"readme":"node-gapitoken\n==============\n\nNode.js module for Google API service account authorization (Server to Server flow). \n\n[![Build Status](https://travis-ci.org/bsphere/node-gapitoken.svg)](https://travis-ci.org/bsphere/node-gapitoken)\n\n\nInstallation\n------------\n\n\tnpm install gapitoken\n\t\nUsage\n-----\n\n    var GAPI = require('gapitoken');\n \n    var gapi = new GAPI({\n        iss: 'service account email address from Google API console',\n        scope: 'space delimited list of requested scopes',\n        keyFile: 'path to private_key.pem'\n    }, function(err) {\n       if (err) { return console.log(err); }\n \n       gapi.getToken(function(err, token) {\n           if (err) { return console.log(err); }\n           console.log(token);\n       });     \n    });\n\nAnother option is to pass the private key as a string\n\n    var key = \"-----BEGIN RSA PRIVATE KEY-----\\n\\\n    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\\n\\\n    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\\n\\\n    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\\n\\\n    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\\n\\\n    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\\n\\\n    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\\n\\\n    -----END RSA PRIVATE KEY-----\";\n\n    var gapi = new GAPI({\n        iss: 'service account email address from Google API console',\n        scope: 'space delimited list of requested scopes',\n        key: key\n    }, function() {\n       gapi.getToken(function(err, token) {\n           if (err) { return console.log(err); }\n           console.log(token);\n       });     \n    });\n\n    \n* for using node-gapitoken to access Google Cloud Storage see https://github.com/bsphere/node-gcs\n\nCreating a Private key file\n---------------------------\n\n1) Login to Google API Console, and under \"API Access\" create a \"service account\" for your project.\n\n2) Download the .p12 private key file\n\n3) Convert the .p12 file to .pem: `openssl pkcs12 -in key.p12 -out key.pem -nocerts`\n\nNOTE: You must set a passphrase for the .pem file\n\n4) Remove the passphrase from the .pem file: `openssl rsa -in key.pem -out key.pem`\n","_attachments":{},"homepage":"https://github.com/bsphere/node-gapitoken","bugs":{"url":"https://github.com/bsphere/node-gapitoken/issues"},"license":"MIT"}