{"_id":"@authing/koa2-oauth-server","_rev":"3-52ba9c746f390d45e480c264d9a2006f","name":"@authing/koa2-oauth-server","dist-tags":{"latest":"2.1.2"},"versions":{"2.1.0":{"name":"@authing/koa2-oauth-server","version":"2.1.0","description":"OAuth provider for Koa2 (fork from waychan23/koa2-oauth-server)","main":"index.js","scripts":{"lint":"jshint .","test":"mocha --recursive test"},"repository":{"type":"git","url":"git://github.com/Authing/koa2-oauth-server.git"},"keywords":["koa","koa2","oauth","oauth2"],"author":{"name":"Nuno Sousa","email":"nfs@seegno.com"},"contributors":[{"name":"Way Chan","email":"waychan23@hotmail.com"},{"name":"xueping","email":"l1968108962@gmail.com"}],"license":"SEE LICENSE IN LICENSE","dependencies":{"bluebird":"^3.0.5","koa":"^2.3.0","node-oauth2-server":"^2.4.0","oauth2-server":"github:Authing/node-oauth2-server"},"devDependencies":{"koa-bodyparser":"^4.2.0","jshint":"^2.8.0","mocha":"^2.3.3","should":"^7.1.0","sinon":"^1.14.1","supertest":"^0.15.0"},"engines":{"node":">=7"},"bugs":{"url":"https://github.com/Authing/koa2-oauth-server/issues"},"homepage":"https://github.com/Authing/koa2-oauth-server#readme","directories":{"example":"examples","test":"test"},"gitHead":"3b387f5cc812320eed63c0983b472286bdf1c266","_id":"@authing/koa2-oauth-server@2.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.14.2","_npmUser":{"name":"authing","email":"xieyang@dodora.cn"},"dist":{"integrity":"sha512-RDxnRnq/ABpyPALdpIOwSj9jNTTjEXtLPWVl0MchJBdAVuLUqdQ5CDtymtDtBG0Es86ohlhSiHh/x7aYtmpsHw==","shasum":"71ff066287e9adf01edc61b819f2296e4ba4ee28","tarball":"https://registry.npmjs.org/@authing/koa2-oauth-server/-/koa2-oauth-server-2.1.0.tgz","fileCount":39,"unpackedSize":81577,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcpsBoCRA9TVsSAnZWagAAUv0P/3KGWbuoiuKzk/qEWHYq\nB5W1FHrZAwVjmG2uRXsC5t/dLzRT0RWbvQaE8k5pJxxhB/8K8jSB3w3OBRA+\nv3W7dbWYOtDE0Hwt2+h+XBZQXvDAsJsB7XHlXyXu2EuE6zbSL6ctWfht2Y+u\nXrmy3tzIk4g3uklzz+y5ahAdsO7VrgYU2g8lzlP4cPDu8pb0EVFUx/9xYUWR\ndsPIWHNwWVK5ABKWOEJGZRh7ncTgjaJJHP41EcmmULUgFSQA0b378d0ec/vo\n+dfM6qJiqk2IXjdguQosXxLv+DVVMRXoN398b6cV55lqQa86nJlkJEXC61j0\nRkEiiruvoo1DoaVmS8bQvnX4NjnfyrkIuM05Hj5URnwxJOmjFVKCrtbTrapM\nKoCpU3lPCvIMSBHHv8KvNRWNGB8yLYef09WOf5sTxfWfeIb8SLp793EGSEtV\ng5Cw1QpJanvVrzfE+wK8YQZqBbdrLiIsuAPV3VPu7t5O4msdIzy4E8t5OXFC\n2XJafxGB+CN102cCnijSU4/sQlEaoVgVFZyZyM2vbCk4GCH/02hFYXrHeyOH\n8n0EkVhzQkUoq09VkGPNh3ETTU3zwbsH86X8mX0JzsRKvrX8E109QxV4Uf14\nHil3iUGk5nNQ7FRpDkg6Y9bsbE5Hm+IVuFG1p5jqWyFayy6TeBFFBGi4VNoA\ngeWB\r\n=c3mE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxEgvA2LvjrM7rrTLZmT27ihKHzfqVnaWzK81RiLsZgAIhAMiUe85xHIZoEXpmNJJpCLpBSlGWIzSw1VJavGl1cHLR"}]},"maintainers":[{"name":"authing","email":"xieyang@dodora.cn"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa2-oauth-server_2.1.0_1554432103676_0.48490336939705236"},"_hasShrinkwrap":false},"2.1.1":{"name":"@authing/koa2-oauth-server","version":"2.1.1","description":"OAuth provider for Koa2 (fork from waychan23/koa2-oauth-server)","main":"index.js","scripts":{"lint":"jshint .","test":"mocha --recursive test"},"repository":{"type":"git","url":"git://github.com/Authing/koa2-oauth-server.git"},"keywords":["koa","koa2","oauth","oauth2"],"author":{"name":"Nuno Sousa","email":"nfs@seegno.com"},"contributors":[{"name":"Way Chan","email":"waychan23@hotmail.com"},{"name":"xueping","email":"l1968108962@gmail.com"}],"license":"SEE LICENSE IN LICENSE","dependencies":{"bluebird":"^3.0.5","koa":"^2.3.0","node-oauth2-server":"^2.4.0","@authing/oauth2-server":"^3.1.0"},"devDependencies":{"koa-bodyparser":"^4.2.0","jshint":"^2.8.0","mocha":"^2.3.3","should":"^7.1.0","sinon":"^1.14.1","supertest":"^0.15.0"},"engines":{"node":">=7"},"bugs":{"url":"https://github.com/Authing/koa2-oauth-server/issues"},"homepage":"https://github.com/Authing/koa2-oauth-server#readme","directories":{"example":"examples","test":"test"},"gitHead":"789f098f9eedcc01fc39422ce3d11aa848b67931","_id":"@authing/koa2-oauth-server@2.1.1","_npmVersion":"5.6.0","_nodeVersion":"9.11.2","_npmUser":{"name":"vincent15","email":"yelexin@hotmail.com"},"dist":{"integrity":"sha512-HD2UjWPPetXbzhp4F5LfxA3OOQrEKEVdKUyNy9KUzvnJUZamHGFaEzXr7ar+/GM9Z+ZS8P52fyZfPFn22ILENg==","shasum":"ffd44155c74b80d3613964011f54e0d400243617","tarball":"https://registry.npmjs.org/@authing/koa2-oauth-server/-/koa2-oauth-server-2.1.1.tgz","fileCount":39,"unpackedSize":81559,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcpwrQCRA9TVsSAnZWagAAFaYP/2l9G3+bzT3VGArm4hDn\nZDmAB5HCVrkQu3ZLLV+L8RLRisUMuLpnD8rTelkThKhdKRM1H4KG4VYDJEK4\neVKbtDok/lg/I+HeRS89VL0KjNFcP4q0zc39sPUpx2buqW54RQzZLZZBAc56\n8ETvTq1D9hTB1YD9bn6W4crPgAygp3uuv84H+CrV2agfLNkIvp2qt1Vw8LDI\n/2h8gVIpm7ON15XEUxAnewStVtvH90FopWJidxYfagfasLHTiVPwGqUOGQmI\nypTHSdZ8zg2Mwaypscm9KwlljbOdSQMsr34oGsFCr2pLAZr1ro9T4Uet/Dwa\nMGpiz1IIslk6sCgsE93prFBsy5C71zQFcc4ir2IpXc3ubpcJUwcbJEjCOXZl\npTabR8r5vgfnEUT1rBGijTh9pRTr9DE+L9CCpDJdqSqCY4cHI56D3lS0Naq+\nEeVxo9vDq9gN+pYgia//ZYATZEcbfo563nXxJ0ZhKfX2dSA0s7brf4QGhzmQ\nJvekB8DaFHhBQYyNaYE9f/CyX0MVFFFDweJWJzdzu0/QWy3VDbF97qxjjCqK\nGLMsKRm12VTpGzsWtn7oT5/w6m+CUFzvyXZ3HUgoWjyIcLXEB2RXkP0CWAjI\nQ5Q9HwedkUqQF1sGEgwrsqZ2mL1F0Qjzlv4/MgYpi4WoNpri3uZA3k8C3Yi7\nsaqy\r\n=hkAn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGvlpzQfG6MPnIcsHCZGRgzUHx2jDXtFQWeihUWgFM6EAiEA1awikO9tpc3oFXY06Mi+PGdObUrpZfSf7bAjWjM7CoQ="}]},"maintainers":[{"name":"authing","email":"xieyang@dodora.cn"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa2-oauth-server_2.1.1_1554451152068_0.7891832955402744"},"_hasShrinkwrap":false},"2.1.2":{"name":"@authing/koa2-oauth-server","version":"2.1.2","description":"OAuth provider for Koa2 (fork from waychan23/koa2-oauth-server)","main":"index.js","scripts":{"lint":"jshint .","test":"mocha --recursive test"},"repository":{"type":"git","url":"git://github.com/Authing/koa2-oauth-server.git"},"keywords":["koa","koa2","oauth","oauth2"],"author":{"name":"Nuno Sousa","email":"nfs@seegno.com"},"contributors":[{"name":"Way Chan","email":"waychan23@hotmail.com"},{"name":"xueping","email":"l1968108962@gmail.com"}],"license":"SEE LICENSE IN LICENSE","dependencies":{"bluebird":"^3.0.5","koa":"^2.3.0","node-oauth2-server":"^2.4.0","@authing/oauth2-server":"^3.1.0"},"devDependencies":{"koa-bodyparser":"^4.2.0","jshint":"^2.8.0","mocha":"^2.3.3","should":"^7.1.0","sinon":"^1.14.1","supertest":"^0.15.0"},"engines":{"node":">=7"},"bugs":{"url":"https://github.com/Authing/koa2-oauth-server/issues"},"homepage":"https://github.com/Authing/koa2-oauth-server#readme","directories":{"example":"examples","test":"test"},"gitHead":"3f330c9c49d16695b1f6b1f0d29c32a256a25cfd","_id":"@authing/koa2-oauth-server@2.1.2","_npmVersion":"5.6.0","_nodeVersion":"9.11.2","_npmUser":{"name":"vincent15","email":"yelexin@hotmail.com"},"dist":{"integrity":"sha512-lTYypCB77Scu1YZRTIhPKjmYMD185S4i6zhsn7/jkCrrHPaXPCxwy5WRcqLRytoQYr4Ta7PnJ0UEuqR71rbPNw==","shasum":"61b96713bed01b642454e9245aaa031d2cc3264d","tarball":"https://registry.npmjs.org/@authing/koa2-oauth-server/-/koa2-oauth-server-2.1.2.tgz","fileCount":39,"unpackedSize":81604,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcpwvyCRA9TVsSAnZWagAAXnoQAKInqB74E3UxgpGpr7K+\nFMxo1edmG4xKz5TJbX8DXlBMIXBe4TGnmHIvUB0/jmJaB2ACndNIYIqTwUIi\naCgIuHPOB2PEnS4eYCd9uS6/h+Us8o+xlRNbGjFpkFnhLDk6wNEmCGF/CLSk\nsu2Mh9WILlKjDaBGyIyG6XQm92sOTbvcVALSVlBaKKdCA86vbd1eDu40Hc1K\nL2hJbHYQoF8nBdKo6qheZAW3HsLH97EhibmF0NblsgEB4wJqfzEZa1SziY+N\nXmXBe+YLt/0PWHn69oY82vQeoAWQPhw8xQiJKkTY/9ZFQG8wRjgpBeRvmb65\nXiKwNMtmW8Tq9diIaKb37RtCZw+vEDK2FWV3ZKhe7cALsSH97LLDOxMolb4E\nAsL/dLBIA0f3gVSAn6Y1DN3MSW+K3FaayvWmaNs7ECzGH+BwBNkBoElMlBr+\nqcznKV2wqqRAnSMtNVHjpdFm5epNdFFxQ8xXudbmnJJafrl+++io6fIl6R/k\nex2tdpMhpYE02ZnlBFHE9hR2bjDwi3VihgGbsVvuqKdkU5MujGWpmMHXqenk\nNLZVNHhWkobVWKcwTlHdWTbXeP/phX8X6vl885iTiz3j9htUjBVSFJkjaOAN\nLubwHnbKhOrVuF1j0Q1XMQ0lVAQUHA/Ar9kEwxQ5IGguqXHDTvwxNNW+8uOa\n2ayJ\r\n=f0zt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfzoI/Fsp/OdTHA0RzEdin7tC2HaoGk59+n4zvXSXBDAIhANpD/5p7N4gcRi7LTGX2twJV++A3rUGpQ6ND1nlBeKJw"}]},"maintainers":[{"name":"authing","email":"xieyang@dodora.cn"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa2-oauth-server_2.1.2_1554451441332_0.5894306469664481"},"_hasShrinkwrap":false}},"time":{"created":"2019-04-05T02:41:43.479Z","2.1.0":"2019-04-05T02:41:44.068Z","modified":"2022-04-04T16:31:50.316Z","2.1.1":"2019-04-05T07:59:12.205Z","2.1.2":"2019-04-05T08:04:01.487Z"},"maintainers":[{"name":"authing","email":"xieyang@dodora.cn"}],"description":"OAuth provider for Koa2 (fork from waychan23/koa2-oauth-server)","homepage":"https://github.com/Authing/koa2-oauth-server#readme","keywords":["koa","koa2","oauth","oauth2"],"repository":{"type":"git","url":"git://github.com/Authing/koa2-oauth-server.git"},"contributors":[{"name":"Way Chan","email":"waychan23@hotmail.com"},{"name":"xueping","email":"l1968108962@gmail.com"}],"author":{"name":"Nuno Sousa","email":"nfs@seegno.com"},"bugs":{"url":"https://github.com/Authing/koa2-oauth-server/issues"},"license":"SEE LICENSE IN LICENSE","readme":"An complete executable example here at: https://github.com/waychan23/koa2-oauth-server/tree/master/examples/complete-example.\n\nThis repository is forked from [express-oauth-server](https://github.com/oauthjs/express-oauth-server). The reason why I choose [express-oauth-server](https://github.com/oauthjs/express-oauth-server) over [koa-oauth-server](https://github.com/oauthjs/koa-oauth-server) is the latter seems to be a little out of maintenance.\n\nComplete, compliant and well tested module for implementing an OAuth2 Server/Provider with [koa2](https://github.com/koajs/koa) in [node.js](http://nodejs.org/).\n\nThis is the koa2 wrapper for [oauth2-server](https://github.com/oauthjs/node-oauth2-server).\n\n## Installation\n\n    $ npm install @authing/koa2-oauth-server\n\n## Quick Start\n\nThe module provides two middlewares - one for granting tokens and another to authorize them. `koa2-oauth-server` and, consequently `oauth2-server`, expect the request body to be parsed already.\nThe following example uses `koa-bodyparser` but you may opt for an alternative library.\n\n```js\nvar bodyParser = require('koa-bodyparser');\nvar koa = require('koa');\nvar OAuthServer = require('koa2-oauth-server');\n\nvar app = new koa();\n\napp.oauth = new OAuthServer({\n  model: {}, // See https://github.com/oauthjs/node-oauth2-server for specification\n});\n\napp.use(bodyParser());\napp.use(app.oauth.authorize());\n\napp.use(async (ctx, next) => {\n  ctx.body = 'Secret area';\n  await next();\n});\n\napp.listen(3000);\n```\n\n## Options\n\n```\nvar options = { \n  useErrorHandler: false, \n  continueMiddleware: false,\n}\n```\n* `useErrorHandler`\n(_type: boolean_ default: false)\n\n  If false, an error response will be rendered by this component.\n  Set this value to true to allow your own error handler to handle the error.\n  \n  **Note:** the `error` object will be passed along the middleware chain as `ctx.state.oauth.error`.\n\n* `continueMiddleware`\n(_type: boolean default: false_)\n\n  The `authorize()` and `token()` middlewares will both render their \n  result to the response and end the pipeline.\n  next() will only be called if this is set to true.\n\n  **Note:** You cannot modify the response since the headers have already been sent.\n\n  `authenticate()` does not modify the response and will always call next()\n","readmeFilename":"Readme.md"}