{
  "_args": [
    [
      {
        "raw": "gtoken@https://registry.npmjs.org/gtoken/-/gtoken-1.2.2.tgz",
        "scope": null,
        "escapedName": "gtoken",
        "name": "gtoken",
        "rawSpec": "https://registry.npmjs.org/gtoken/-/gtoken-1.2.2.tgz",
        "spec": "https://registry.npmjs.org/gtoken/-/gtoken-1.2.2.tgz",
        "type": "remote"
      },
      "E:\\MissionXJC\\XJC\\functions\\node_modules\\firebase-admin"
    ]
  ],
  "_from": "gtoken@>=1.2.1 <2.0.0",
  "_id": "gtoken@1.2.2",
  "_inCache": true,
  "_location": "/firebase-admin/gtoken",
  "_phantomChildren": {},
  "_requested": {
    "raw": "gtoken@https://registry.npmjs.org/gtoken/-/gtoken-1.2.2.tgz",
    "scope": null,
    "escapedName": "gtoken",
    "name": "gtoken",
    "rawSpec": "https://registry.npmjs.org/gtoken/-/gtoken-1.2.2.tgz",
    "spec": "https://registry.npmjs.org/gtoken/-/gtoken-1.2.2.tgz",
    "type": "remote"
  },
  "_requiredBy": [
    "/firebase-admin",
    "/firebase-admin/google-auth-library"
  ],
  "_resolved": "https://registry.npmjs.org/gtoken/-/gtoken-1.2.2.tgz",
  "_shasum": "172776a1a9d96ac09fc22a00f5be83cee6de8820",
  "_shrinkwrap": null,
  "_spec": "gtoken@https://registry.npmjs.org/gtoken/-/gtoken-1.2.2.tgz",
  "_where": "E:\\MissionXJC\\XJC\\functions\\node_modules\\firebase-admin",
  "author": {
    "name": "Ryan Seys"
  },
  "bugs": {
    "url": "https://github.com/ryanseys/node-gtoken/issues"
  },
  "dependencies": {
    "google-p12-pem": "^0.1.0",
    "jws": "^3.0.0",
    "mime": "^1.2.11",
    "request": "^2.72.0"
  },
  "description": "Node.js Google Authentication Service Account Tokens",
  "devDependencies": {
    "mocha": "^2.0.1"
  },
  "homepage": "https://github.com/ryanseys/node-gtoken#readme",
  "keywords": [
    "google",
    "service",
    "account",
    "api",
    "token",
    "api",
    "auth"
  ],
  "license": "MIT",
  "main": "./lib/index.js",
  "name": "gtoken",
  "optionalDependencies": {},
  "readme": "# node-gtoken\n\nNode.js Google Authentication Service Account Tokens\n\n[![Build Status](https://travis-ci.org/ryanseys/node-gtoken.svg?branch=master)](https://travis-ci.org/ryanseys/node-gtoken)\n\n## Installation\n\n``` sh\nnpm install gtoken\n```\n\n## Usage\n\n### Use with a `.pem` or `.p12` key file:\n\n``` js\nvar GoogleToken = require('gtoken');\nvar gtoken = GoogleToken({\n  keyFile: 'path/to/key.pem', // or path to .p12 key file\n  email: 'my_service_account_email@developer.gserviceaccount.com',\n  scope: ['https://scope1', 'https://scope2'] // or space-delimited string of scopes\n});\n\ngtoken.getToken(function(err, token) {\n  if (err) {\n    console.log(err);\n    return;\n  }\n  console.log(token);\n});\n```\n\n### Use with a service account `.json` key file:\n\n``` js\nvar GoogleToken = require('gtoken');\nvar gtoken = GoogleToken({\n  keyFile: 'path/to/key.json',\n  scope: ['https://scope1', 'https://scope2'] // or space-delimited string of scopes\n});\n\ngtoken.getToken(function(err, token) {\n  if (err) {\n    console.log(err);\n    return;\n  }\n  console.log(token);\n});\n```\n\n### Pass the private key as a string directly:\n\n``` js\nvar key = '-----BEGIN RSA PRIVATE KEY-----\\nXXXXXXXXXXX...';\nvar GoogleToken = require('gtoken');\nvar gtoken = GoogleToken({\n  email: 'my_service_account_email@developer.gserviceaccount.com',\n  scope: ['https://scope1', 'https://scope2'], // or space-delimited string of scopes\n  key: key\n});\n```\n\n## Options\n\n> Various options that can be set when creating initializing the `gtoken` object.\n\n- `options.email or options.iss`: The service account email address.\n- `options.scope`: An array of scope strings or space-delimited string of scopes.\n- `options.sub`: The email address of the user requesting delegated access.\n- `options.keyFile`: The filename of `.json` key, `.pem` key or `.p12` key.\n- `options.key`: The raw RSA private key value, in place of using `options.keyFile`.\n\n### .getToken(callback)\n\n> Returns the cached token or requests a new one and returns it.\n\n``` js\ngtoken.getToken(function(err, token) {\n  console.log(err || token);\n  // gtoken.token value is also set\n});\n```\n\n### Properties\n\n> Various properties set on the gtoken object after call to `.getToken()`.\n\n- `gtoken.token`: The access token.\n- `gtoken.expires_at`: The expiry date as milliseconds since 1970/01/01\n- `gtoken.key`: The raw key value.\n- `gtoken.raw_token`: Most recent raw token data received from Google.\n\n### .hasExpired()\n\n> Returns true if the token has expired, or token does not exist.\n\n``` js\ngtoken.getToken(function(err, token) {\n  if(token) {\n    gtoken.hasExpired(); // false\n  }\n});\n```\n\n### .revokeToken()\n\n> Revoke the token if set.\n\n``` js\ngtoken.revokeToken(function(err) {\n  if (err) {\n    console.log(err);\n    return;\n  }\n  console.log('Token revoked!');\n});\n```\n\n## Downloading your private `.p12` key from Google\n\n1. Open the [Google Developer Console][gdevconsole].\n2. Open your project and under \"APIs & auth\", click Credentials.\n3. Generate a new `.p12` key and download it into your project.\n\n## Converting your `.p12` key to a `.pem` key\n\nYou can just specify your `.p12` file (with `.p12` extension) as the `keyFile` and it will automatically be converted to a `.pem` on the fly, however this results in a slight performance hit. If you'd like to convert to a `.pem` for use later, use OpenSSL if you have it installed.\n\n``` sh\n$ openssl pkcs12 -in key.p12 -nodes -nocerts > key.pem\n```\n\nDon't forget, the passphrase when converting these files is the string `'notasecret'`\n\n## License\n\nMIT\n\n[gdevconsole]: https://console.developers.google.com\n",
  "readmeFilename": "README.md",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/ryanseys/node-gtoken.git"
  },
  "scripts": {
    "test": "mocha --timeout 5000"
  },
  "version": "1.2.2"
}
