{"_id":"@egodigital/oauth2-client","_rev":"9-1e71b9c9d035f6d0cf76f6442d0e5e43","name":"@egodigital/oauth2-client","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@egodigital/oauth2-client","version":"1.0.0","description":"Functions and classes for easily handling OAuth 2 operations.","main":"lib/index.js","scripts":{"build":"(rm -r ./lib || true) && (tsc && tsc -d)","deploy":"npm install && npm audit fix && npm run build && npm publish","doc":"(rm -r ./doc || true) && (\"./node_modules/.bin/typedoc\" --out ./doc ./src)","sandbox":"npm run build && node ./lib/sandbox.js --inspect=0.0.0.0:9229","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/egodigital/oauth2-client.git"},"keywords":["oauth2","client","functions","classes"],"author":{"name":"e.GO Digital GmbH, Aachen, Germany"},"license":"LGPL-3.0","dependencies":{"@types/node":"^10.17.5","got":"^9.6.0","moment":"^2.24.0","moment-timezone":"^0.5.27"},"devDependencies":{"@egodigital/tsconfig":"^1.3.0","@types/got":"^9.6.9","@types/moment-timezone":"^0.5.12","tslint":"^5.20.1","typedoc":"^0.15.0","typescript":"^3.7.2"},"gitHead":"cf75d3bf2d097ef77d9b144b971a52515187933a","bugs":{"url":"https://github.com/egodigital/oauth2-client/issues"},"homepage":"https://github.com/egodigital/oauth2-client#readme","_id":"@egodigital/oauth2-client@1.0.0","_nodeVersion":"12.11.1","_npmVersion":"6.13.0","dist":{"integrity":"sha512-w+0uEFdIgi4iWIl7vwHgK+kGk/TEsBAtwQtXSqnXYMRgwp3528M1BW0WUXxenYnduaMM9n4U9DbkJrJH95Hwpw==","shasum":"935ae67580f864e7417b46b2e9b2292cdc9abd19","tarball":"https://registry.npmjs.org/@egodigital/oauth2-client/-/oauth2-client-1.0.0.tgz","fileCount":16,"unpackedSize":32365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdydDhCRA9TVsSAnZWagAAOc8P/0hreabPQ/0uXhRZXT2F\n81Hf3Jr7QrS+Y47cUvnf+NMOl7hE0uJkPnlbZxfv1gSm/C7iBBphSc9eJ9Ry\nIDPVV2Iw42eWUHcumQVdpVfE1phlL8tcgSbQHhSEnje2ywMcDuwWvx0h+z9s\nPqIPbPj5iV0kbRB481dyHvdMJ9ZMWyf898hOV09GKwXxkDKSi0eDiV97k/mj\nvo5h8JALB7lXRvjB2ouo2BUKm3a+WIsXgNDDcwnJvng1eUimfVm5Ahpq5xue\nK/yylAlUzrfjVQECwMKMskBNEgd+Tw04KpNzbcINlGs9XLlqIBzQYFIc5M7Z\nFeHsWbdljOXGiBkJyUAkkcQa79cNen/Tgidqj5KWq6PHn5PR+rGommE63Twu\nzIGlIDu2+67NiDXmqNgdh0xw3DwiRjTXJAKnscDLu/7NqUnNYjpG6qULBSLz\nkXkwI23VkWI5ZHv6WLw/bCC/l4Ceoafq/jrwPZiVi/ypAmeB599Axkr+/2cw\nawke41GmKcTGFKv5fjxM40J/Iz+EMsIl6wbi9yXvOKUkEcacWogd0Kax2QVX\nt788AftAxr7jvwkycW6bfiDsVaQDK3fpwo5YyePNGzJq8dyVlttHizL5zQkn\nbY4heTuzjfkAOnANXm+keDdza8tUe8Lv81aSkrDpjMbfT/yCFB2djtv7ZhCv\nf473\r\n=ncEa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDI0TRdKFs7Fj8ENVkW0Iqwj4/0+gzvgAwiiYPoqDR6rQIhANjHK3e7PZuMjgzOa4wv9ItfM0zfmGctpCGccW29ecf/"}]},"maintainers":[{"name":"mkloubert","email":"marcel.kloubert@gmx.net"},{"name":"mkloubertego","email":"marcel.kloubert@e-go-digital.com"},{"name":"ekegodigital","email":"eric.kesseler@e-go-digital.com"}],"_npmUser":{"name":"mkloubertego","email":"marcel.kloubert@e-go-digital.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/oauth2-client_1.0.0_1573507296878_0.2903091996581486"},"_hasShrinkwrap":false},"1.0.1":{"name":"@egodigital/oauth2-client","version":"1.0.1","description":"Functions and classes for easily handling OAuth 2 operations.","main":"lib/index.js","scripts":{"build":"(rm -r ./lib || true) && (tsc && tsc -d)","deploy":"npm install && npm audit fix && npm run build && npm publish","doc":"(rm -r ./doc || true) && (\"./node_modules/.bin/typedoc\" --out ./doc ./src)","sandbox":"npm run build && node ./lib/sandbox.js --inspect=0.0.0.0:9229","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/egodigital/oauth2-client.git"},"keywords":["oauth2","client","functions","classes"],"author":{"name":"e.GO Digital GmbH, Aachen, Germany"},"license":"LGPL-3.0","dependencies":{"@types/node":"^10.17.5","got":"^9.6.0","moment":"^2.24.0","moment-timezone":"^0.5.27"},"devDependencies":{"@egodigital/tsconfig":"^1.3.0","@types/got":"^9.6.9","@types/moment-timezone":"^0.5.12","tslint":"^5.20.1","typedoc":"^0.15.0","typescript":"^3.7.2"},"gitHead":"d2f4ac152948adc0fa696795d8688754d9e7b48d","bugs":{"url":"https://github.com/egodigital/oauth2-client/issues"},"homepage":"https://github.com/egodigital/oauth2-client#readme","_id":"@egodigital/oauth2-client@1.0.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-02DObF1OsSuJlloCqb0XrBmaDRh59G5CPKSZn7B9jcpycX7UFnniuo/gu9Q8Xd8pUjNe7vDkI2VO/meVnKatPQ==","shasum":"fbd8123baa9d4d0b05ddcff1ecaceba89054ab39","tarball":"https://registry.npmjs.org/@egodigital/oauth2-client/-/oauth2-client-1.0.1.tgz","fileCount":14,"unpackedSize":32140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdydOLCRA9TVsSAnZWagAA9UoP/0zZPKbbanh4FHGOCfyW\n+bI6UNry36AjEAlvxfCYW7dSRU1l5dFRH7guQ9Lui/NmswmpRbUb4V+q/YX4\nW8mTj5jI4d3DGYLSqFbT00hbRZj+av16hIiTMxQiOlea+cHzBNSQfofW/PIJ\n3BoX5nd7KynPu5BorgZK3TXE6dQ1/9KyTH27d/aXL9cSkHjd4vzA8TA3XK82\nXd6aEPTsQ3z9/qTV+u1HjDJarMulsHC+/rbz1hw9Xplh0stIOy33zi2LISWt\nX5IQli/LrCPj+gVxgoLLhoxe3rs42GEjWZJVB1L1DEeujS6EKMPe2Un200fI\n1xGRXUUOn9HW3n9/GbtotZxd1XGs/21OGroMICW3rnka1DiUqIH6IrRtW08Q\nn5iH1np2nvqlnHAnGaBYizvL3dMEhagPzDNySQ+FmaPLT5GQmkhGy7DmMP80\nIsLlYzISjjXs+x1LeaptMGJ1jdvpWExYsegbi50GQDAWezDXBg8IF68AbWEs\nnduuyCPntlb6H6/auDjtC209erZfjlnVWUVw9v5avgYgP1nBXT7cY/nzhhQf\nA/6kgqqz1r6Xz3BUJZhPjqZXjSR6A2o67HKtGip6BWw9nYjYOcalJC7fGy8b\nHVE4jg51v1p3+12PwxuPFTNaBqFH8nGwgOTuOFTCQYBVf293XO7ByFzhYZQV\ngTHy\r\n=8VYo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDUIZiiMXUnMu6Jz2I7lhBWn6FfYYfNk2n+x62lUwCewIhAPW4bjpfwHky15i/NULgDUIveZzXxb4HYpCq9cB85MoC"}]},"maintainers":[{"name":"ekegodigital","email":"eric.kesseler@e-go-digital.com"},{"name":"mkloubert","email":"marcel.kloubert@gmx.net"},{"name":"mkloubertego","email":"marcel.kloubert@e-go-digital.com"}],"_npmUser":{"name":"mkloubertego","email":"marcel.kloubert@e-go-digital.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/oauth2-client_1.0.1_1573507978927_0.9195748676924069"},"_hasShrinkwrap":false},"1.0.2":{"name":"@egodigital/oauth2-client","version":"1.0.2","description":"Functions and classes for easily handling OAuth 2 operations.","main":"lib/index.js","scripts":{"build":"(rm -r ./lib || true) && (tsc && tsc -d)","deploy":"npm install && npm audit fix && npm run build && npm publish","doc":"(rm -r ./doc || true) && (\"./node_modules/.bin/typedoc\" --out ./doc ./src)","sandbox":"npm run build && node ./lib/sandbox.js --inspect=0.0.0.0:9229","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/egodigital/oauth2-client.git"},"keywords":["oauth2","client","functions","classes"],"author":{"name":"e.GO Digital GmbH, Aachen, Germany"},"license":"LGPL-3.0","dependencies":{"@types/node":"^10.17.5","got":"^9.6.0","moment":"^2.24.0","moment-timezone":"^0.5.27"},"devDependencies":{"@egodigital/tsconfig":"^1.3.0","@types/got":"^9.6.9","@types/moment-timezone":"^0.5.12","tslint":"^5.20.1","typedoc":"^0.15.0","typescript":"^3.7.2"},"gitHead":"15fdce6d3f7e8cf486e6b95c21f152abd981bc20","bugs":{"url":"https://github.com/egodigital/oauth2-client/issues"},"homepage":"https://github.com/egodigital/oauth2-client#readme","_id":"@egodigital/oauth2-client@1.0.2","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-JMIXuRXXV6+UURuQWPY995hgacoJfvcXqhI4RFO8Gp0cl0wg6qF2CZz5hcabUanbCiw5VczmvG+xnl8+B6Z72Q==","shasum":"2bbb46b727b8b4c677e50cbd0193e8181fd56056","tarball":"https://registry.npmjs.org/@egodigital/oauth2-client/-/oauth2-client-1.0.2.tgz","fileCount":14,"unpackedSize":32244,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2FelCRA9TVsSAnZWagAAZOsP/2ozhupthMvPVQUb4H74\nMpqTEpVP4FRLqQK1z0rLg2aTlMbg1Zqv9z/YNKfebi3t2cgIwqUUo+RWDSCA\nm9/OjQa6hMbnkVC6hon1Jgkiy3S3ZriJgVO5CwREiuytBcwFaJWKw4+fyArH\nTS63j1gRhR2l1d9UKS5BE2E7tW9MwalaejeqXZqR9J7RhK2YNADBp4ALHAzY\n1KxdS8LoBAIxX9n6l+IAnRsW7ZouIyncR/MxdO/k9Gn+hL36jGgkB8QjZVAM\njW7OGUz/9A3TIfX2W8OpV4UMN3fkO5aIiSRJcVFZWWczNVEJlq7ZaFP/rCeE\nMh9FGDuUYaled/JIJ4nd0BdGRlNgVPIS9++dd8y1/fsTSYduUSDcOpFcH9x+\nyg/+NnJiMEGjEGHSwt+5hjA4cUb6IuMhPHU5tjTprq/yGuOgYqCSgCAou1dE\nN2bs86kRj721seg0QfElwAp7rqmxPZ8jh6s/dA9u53ZQJ49DvkZGsIEaSiN1\nZjTgPBXW/QEBxbwJtkH+Q8Y3ffSyiKq83u7KTXK7pwrF+mdHYcQKx4ZtGc/i\nnlDAOqTShGv4IzRW+Bp4oVLeVVn6xES67GFI4zn1RtZga/JPXZTZwz6q7qA7\n7VmCvVWop3R+fI6Z61LrtGqDI1lnuJON9Nkbi72vvvutayyhW3Jpl7n0cR/J\nRvjq\r\n=zHXK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEcQeuNvQi+IZpXJplVTVr837wi+Mc485LtXsQIcKEueAiAQgB5OlLq/lY8Xl1k8qe+PeH1851EQOGvdEuz2cgK9pQ=="}]},"maintainers":[{"name":"ekegodigital","email":"eric.kesseler@e-go-digital.com"},{"name":"mkloubert","email":"marcel.kloubert@gmx.net"},{"name":"mkloubertego","email":"marcel.kloubert@e-go-digital.com"}],"_npmUser":{"name":"mkloubertego","email":"marcel.kloubert@e-go-digital.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/oauth2-client_1.0.2_1573508245246_0.4874071072026609"},"_hasShrinkwrap":false}},"time":{"created":"2019-11-11T21:21:36.793Z","1.0.0":"2019-11-11T21:21:37.047Z","modified":"2024-05-22T18:03:30.337Z","1.0.1":"2019-11-11T21:32:59.092Z","1.0.2":"2019-11-11T21:37:25.432Z"},"maintainers":[{"email":"eric.kesseler@e-go-mobile.com","name":"ekmobile"},{"email":"dux-developer@e-go-mobile.com","name":"egodux"},{"email":"marcel.kloubert@gmx.net","name":"mkloubert"},{"email":"eric.kesseler@e-go-digital.com","name":"ekegodigital"}],"description":"Functions and classes for easily handling OAuth 2 operations.","homepage":"https://github.com/egodigital/oauth2-client#readme","keywords":["oauth2","client","functions","classes"],"repository":{"type":"git","url":"git+https://github.com/egodigital/oauth2-client.git"},"author":{"name":"e.GO Digital GmbH, Aachen, Germany"},"bugs":{"url":"https://github.com/egodigital/oauth2-client/issues"},"license":"LGPL-3.0","readme":"[![npm](https://img.shields.io/npm/v/@egodigital/oauth2-client.svg)](https://www.npmjs.com/package/@egodigital/oauth2-client)\n\n# @egodigital/oauth2-client\n\nFunctions and classes for easily handling [OAuth 2](https://oauth.net/2/) operations, written for [Node.js 10+](https://nodejs.org/dist/latest-v10.x/docs/api/) in [TypeScript](https://www.typescriptlang.org/).\n\nThe library is based on the concept of [oauth2-server](https://github.com/oauthjs/node-oauth2-server).\n\n## Install\n\nExecute the following command from your project folder, where your `package.json` file is stored:\n\n```bash\nnpm install --save @egodigital/oauth2-client\n```\n\n## Documentation\n\nAPI documentation can be found [here](https://egodigital.github.io/oauth2-client/).\n\n## Usage\n\nFirst define the following environment variables:\n\n| Name                   | Description                          | Example                                |\n|------------------------|--------------------------------------|----------------------------------------|\n| `OAUTH2_CLIENT_ID`     | The ID of the OAuth2 client.         | `147a67e2-a5f0-43b5-90d3-0deb35895826` |\n| `OAUTH2_CLIENT_SECRET` | The secret of the OAuth2 client.     | `ASitBUoQ7ovXVDc6hPUzq`                |\n| `OAUTH2_KEY`           | The key for the admin API.           | `ou3I3Rj8UdBChAgAdzNkeF`               |\n| `OAUTH2_URL`           | The base URL of the OAuth 2 service. | `https://oauth2.example.com`           |\n\n### Tokens\n\n#### Users\n\n##### Get a new token\n\n```typescript\nimport { getUserToken } from '@egodigital/oauth2-client';\n\nconsole.log(\n    await getUserToken('myUsername', 'myP@ssword123!')\n);\n```\n\n##### Get info\n\n```typescript\nimport { getUserInfo } from '@egodigital/oauth2-client';\n\nconsole.log(\n    await getUserInfo('myAccessToken')\n);\n```\n\n##### Revoke token\n\n```typescript\nimport { revokeToken } from '@egodigital/oauth2-client';\n\nconsole.log(\n    await revokeToken('myAccessToken')\n);\n```\n\n### Admin API\n\n#### Clients\n\n##### Create a client\n\n```typescript\nimport { createClient } from '@egodigital/oauth2-client';\n\nconsole.log(\n    await createClient({\n        'name': 'My awesome app',\n    })\n);\n```\n\n##### List all clients\n\n```typescript\nimport { getClients } from '@egodigital/oauth2-client';\n\nconsole.log(\n    await getClients()\n);\n```\n\n##### Get a specific client\n\n```typescript\nimport { getClient } from '@egodigital/oauth2-client';\n\nconsole.log(\n    await getClient('myClientId')\n);\n```\n\n##### Delete a client\n\n```typescript\nimport { deleteClient } from '@egodigital/oauth2-client';\n\nconsole.log(\n    await deleteClient('myClientId')\n);\n```\n","readmeFilename":"README.md"}