{"_id":"@daneroo/get-me-a-googleapi-refresh-token","_rev":"2-0b1086ad7097f23e02fe23e4e420f4d7","name":"@daneroo/get-me-a-googleapi-refresh-token","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@daneroo/get-me-a-googleapi-refresh-token","version":"1.0.0","description":"- Get or validate a refresh token","main":"src/index.js","scripts":{"start":"node src/index.js","test":"npm run lint && npm audit && npm run unit","lint":"standard","unit":"jest","unit:watch":"jest --watchAll","coverage":"jest --collectCoverageFrom=src/**.js --coverage src"},"repository":{"type":"git","url":"git+https://github.com/daneroo/gphotos-googleapis.git"},"keywords":[],"author":"","license":"ISC","bugs":{"url":"https://github.com/daneroo/gphotos-googleapis/issues"},"homepage":"https://github.com/daneroo/gphotos-googleapis#readme","dependencies":{"google-auth-library":"^5.7.0","open":"^7.0.0","request-promise":"^4.2.5","server-destroy":"^1.0.1","yargs":"^15.0.2"},"devDependencies":{"jest":"^24.9.0","standard":"^14.3.1"},"standard":{"env":{"node":true,"jest":true}},"gitHead":"c2791e60db2fc98235d085923bae375c596f493c","_id":"@daneroo/get-me-a-googleapi-refresh-token@1.0.0","_nodeVersion":"13.3.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-lhfxZ5Ed1a0yE98zjtfsjdB6fwayjthZyNwtDfVcLgplTu+S6ZzI9J1g3eKq0WpwHrWd08ITj8ETYlaU0oPhCA==","shasum":"5108dff7cc34df6d405359aa947f4320666c84e0","tarball":"https://registry.npmjs.org/@daneroo/get-me-a-googleapi-refresh-token/-/get-me-a-googleapi-refresh-token-1.0.0.tgz","fileCount":8,"unpackedSize":23106,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeCDNlCRA9TVsSAnZWagAA+iIQAJRpuYOuES8y6ngwPHyB\nVtmQho1zvCUIrIQ0cSEu0NV5S4GrGgffEEqWTIZqoZx0orT0VM+PLNc3+xYy\nwD5jvMh0b/aRVCDcsxBPoVvl9ieFRNC8TbCFi7ZD/cN56SYrkaxGOq5qQKyI\nb4ZUfhXz0iSOKQhQosZX3PDfV9E3KE33rfIjhc4g3xsXvuY+8Hq425/qPcvM\nPzt0/Y0/9w4R6lO3FrOVhAfvfslxufIc6EOvUI2zaoRVBQoYHwxWrCnt0A5f\n+VNkBYSEXVzXDd2sYDoMq8ogGAlF7yhCS+SMzhUwHX8No6xdyIZwkV1iwnVy\nz8A0pgjSClb8aTzT0NCcUDmmMvNn9qfUoOLmCczInUvDpEJDo8k5qJJZFazS\nYIIRMNcYJspt4XDIWRpHtKszf0+7iJoBM0v9PgAJ+o646PQqNtCdjEKt5b8W\nSLwbyR8QCudO6ixd2XfOBHQjOBKKsHnKm/Y+f17CJbWfZUSh05VcxEX4vQSH\nHJ9kDqB2eZ5IYWIcGeBE1G6vqbfPGmpkwvhfwstjCbsqLwHB2O22N1a2AGaz\nTCtyLgFm36PvhdAJpLVNOF2cNz/3VMwqaQ5MCuW4/DOxID7vPPCA0Bilb6LV\nHJXQSlsapjcaPi2Byx+eSo4qVlyRp165F9MmzL2HCoQbsu1XNzPCc9lokUEw\nFraZ\r\n=7234\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCoaTIvz/xT35QdmH9SFsNzDtQ0tjhftIn4wKPbnfkiRgIgYhzxaWcmbbc3bpkjPW5aRGhbWcAJkihBWg4R5DGweHM="}]},"maintainers":[{"name":"daneroo","email":"daniel.lauzon@gmail.com"}],"_npmUser":{"name":"daneroo","email":"daniel.lauzon@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/get-me-a-googleapi-refresh-token_1.0.0_1577595749134_0.4862375972933044"},"_hasShrinkwrap":false},"1.0.1":{"name":"@daneroo/get-me-a-googleapi-refresh-token","version":"1.0.1","description":"- Get or validate a refresh token","main":"src/index.js","scripts":{"start":"node src/index.js","test":"npm run lint && npm audit && npm run unit","lint":"standard","unit":"jest","unit:watch":"jest --watchAll","coverage":"jest --collectCoverageFrom=src/**.js --coverage src"},"repository":{"type":"git","url":"git+https://github.com/daneroo/gphotos-googleapis.git"},"keywords":[],"author":"","license":"ISC","bugs":{"url":"https://github.com/daneroo/gphotos-googleapis/issues"},"homepage":"https://github.com/daneroo/gphotos-googleapis#readme","dependencies":{"google-auth-library":"^5.7.0","open":"^7.0.0","request-promise":"^4.2.5","server-destroy":"^1.0.1","yargs":"^15.0.2"},"devDependencies":{"jest":"^24.9.0","standard":"^14.3.1"},"standard":{"env":{"node":true,"jest":true}},"gitHead":"f1e2218ec1d1a4090e5ea242722bdc33593320d1","_id":"@daneroo/get-me-a-googleapi-refresh-token@1.0.1","_nodeVersion":"13.3.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-OLtp5fbbop7AtoS2wWjkm7Ak5K5xrUP2EXFICrGhri0Nr58F4rAhSxuQuq7zMlaMutrSifzTU4eHQGPQy7kCSw==","shasum":"094ef59944cd0610d209ea7fdb7119869a53d065","tarball":"https://registry.npmjs.org/@daneroo/get-me-a-googleapi-refresh-token/-/get-me-a-googleapi-refresh-token-1.0.1.tgz","fileCount":8,"unpackedSize":23106,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeCDOsCRA9TVsSAnZWagAAbmMP/3Nbshaj7aby6t3B070j\nzxT9pwYdou/dcYpHDoFrJWWnRpxKJmOWO5oD70ZeAeRZ4iQf385Ro9iCo2bS\n+NxeTQdzW3iknOtasj/w8qelVfnjdcr8MhfUzaVGH8RHgKvriJDXGPA8ThKC\nXXx1VSfJpCCGzJW448Eb2sdlhhIPbtMqc4yR4v2BCAu0aLIpEsGVoM26P9vx\nhDd0/or/XSGkubda+NKxcr9XGBnHc5R1xFoWmkNrGPZaG5ZbE0SLFRvp26Dn\napc8TEIU/XZ9U+oWJ+7J1pqxyeKMdKaDHNhczkYM5MvUhc7BZzVQKhnt5ajM\nMQw3adR2JOTimrnTJNnuIfbiHMpGqZhqPvgIe4mgv9I24WyuBIQ8Kd9Wngs0\ntG1PY80ouZA9c7PNWC3vxtysyD4RlmY6veJFfR3RNMtC1vQm/aXYuDtfiAEU\nJfTqyfPCrsqRM/KSYmk5wpJqFvc3rFqZ28KcYnTrbXTJA11uXfRa48rcntXg\nOZI+TygyZj9vfTgKT3B0mJQzWSMSomRGiL8NOpoPUkpelk1Vu6N+TQr4P6kf\nN/E/gi2H86y3kDMo4a2pxEaka/j6FZ+CEdwqByTWA0X+OTIe5SekoXn1M8fJ\nftiqG88NSdTQorNbcsmzgOlUqDKr70AO2r/Tru7I64dc//a7SQdtc/c8os4+\n/5MB\r\n=+hvK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDpzNtNXfjsSpmcoDKiETPDYoSFmgo69jWKbF5QFOxDuwIgEUUE1gRG7gBUJr8hC1+Z5G3GA0witu31TW/wfwqb2Y0="}]},"maintainers":[{"name":"daneroo","email":"daniel.lauzon@gmail.com"}],"_npmUser":{"name":"daneroo","email":"daniel.lauzon@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/get-me-a-googleapi-refresh-token_1.0.1_1577595819787_0.9859721927956449"},"_hasShrinkwrap":false}},"time":{"created":"2019-12-29T05:02:29.103Z","1.0.0":"2019-12-29T05:02:29.247Z","modified":"2022-04-05T02:40:05.314Z","1.0.1":"2019-12-29T05:03:39.923Z"},"maintainers":[{"name":"daneroo","email":"daniel.lauzon@gmail.com"}],"description":"- Get or validate a refresh token","homepage":"https://github.com/daneroo/gphotos-googleapis#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/daneroo/gphotos-googleapis.git"},"bugs":{"url":"https://github.com/daneroo/gphotos-googleapis/issues"},"license":"ISC","readme":"# get-me-a-googleapi-refresh-token\n\nThe purpose of this package is to encapsulate authentication to Google APIs with OAuth2.\n\nIn particular we want to provision/verify refresh tokens *locally for a developer*, to test interacting with such a service.\n\n*This is meant to get local credententials, for local development (i.e. the OAuth callback is on <http://127.0.0.1>).*\n\nThis library depends on the Google maintained [google-auth-library](https://github.com/googleapis/google-auth-library-nodejs#oauth2) package\n\nThe basics of Google's OAuth2 implementation is explained on [Google Authorization and Authentication documentation](https://developers.google.com/identity/protocols/OpenIDConnect).\n\n## Publish\n\n```bash\nnpm publish --access public\n```\n\n## TODO\n\n- Rename public methods\n- Test\n- Publish, use in gphotos-googleapis\n- Specific validators or url\n- Implement refreshTokensDB.json (-db)\n  - persist refresh token by account/id\n- renovate\n\n## Scopes\n\nTo identify a requested token with an `sub/id` field, we need to add `https://www.googleapis.com/auth/userinfo.profile` to our requested scopes. This is equivalent to the `profile` scope, and also provides us with a `name,given_name,family_name,picture` fields. You can also use `openid` as a requested scope, which will give ths `sub,picture` identification fields, but no name.\n\n## Usage\n\n- setup\n- generate\n- validate\n\n## Parts\n\nSome parts are harder to automate, so this description is still necessary\n\n### Preparing - Creating Project and credentials\n\nBefore your application can use Google's OAuth 2.0 authentication system for user login, you must set up a project in the [Google API Console](https://console.developers.google.com/) to obtain OAuth 2.0 credentials and set an authentication callback (redirectUri).\n\n- Goto [Google API Console](https://console.developers.google.com/)\n- Create (or select an existing) Project\n- Enable the API's you want to use in the [APIs & Services Section/Library](https://console.developers.google.com/apis/library)\n- Go to [APIs and Services / Credentials tab](https://console.developers.google.com/apis/credentials).\n- Create credentials > OAuth client ID\n- Set the authorized JavaScript origin to <http://127.0.0.1> and the authorized redirect URL to <http://127.0.0.1:8080/auth/google/callback>. (The callback path can be any path you choose you choose)\n- You can then copy the three pieces of information we need (or download the json credentials from the console)\n  - Client ID\n  - Client Secret\n  - Redirect URI's\n\n## References\n\n- <https://github.com/googleapis/google-auth-library-nodejs#oauth2>\n- <https://github.com/googlesamples/google-photos/tree/master/REST/PhotoFrame>\n","readmeFilename":"README.md"}