{"_id":"@after_ice/eve-sso","_rev":"1-69a5804b2121c4391ac8dbd629893f66","name":"@after_ice/eve-sso","dist-tags":{"latest":"2.0.2"},"versions":{"2.0.1":{"name":"@after_ice/eve-sso","version":"2.0.1","description":"Eve Online Single Sign On (SSO)","main":"./dist/index.js","author":{"name":"Michiel van der Velde","email":"michiel@michielvdvelde.nl"},"homepage":"http://github.com/LakMoore/eve-sso","repository":{"type":"git","url":"git+https://github.com/LakMoore/eve-sso.git"},"engines":{"node":">=10"},"keywords":["eve","online","sso","esi"],"license":"MIT","dependencies":{"form-urlencoded":"^6.0.5","jsonwebtoken":"^8.5.1","jwks-rsa":"^2.0.5","node-fetch":"^2.6.11"},"devDependencies":{"@types/jsonwebtoken":"^8.5.6","@types/node-fetch":"^2.6.4"},"types":"./dist/index.d.ts","gitHead":"0719810835e33e19ba4813c2bffbde13715e0d96","bugs":{"url":"https://github.com/LakMoore/eve-sso/issues"},"_id":"@after_ice/eve-sso@2.0.1","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-o1nRloq+y+rqvwNCeP+R+daPRpQejGxZoH7HY6Pj/K4ixNdsrnopou+lLqdHDxOQ2bMPy3QFmJ/sM4Km+gB7iw==","shasum":"f1eed7d32e80596e7d127e0f68437c1e41b2ff52","tarball":"https://registry.npmjs.org/@after_ice/eve-sso/-/eve-sso-2.0.1.tgz","fileCount":5,"unpackedSize":10236,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHnpvs+01DP+03OUexf7q0U8NadETPD9+zs+HXWM0BLCAiEAxLXdvvXUoeO4atU++M05QpFIspXbgBh7fvjHFFxGnAw="}]},"_npmUser":{"name":"lak_moore","email":"stuart@equipmyschool.com"},"directories":{},"maintainers":[{"name":"lak_moore","email":"stuart@equipmyschool.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eve-sso_2.0.1_1685029109451_0.7685753053563456"},"_hasShrinkwrap":false},"2.0.2":{"name":"@after_ice/eve-sso","version":"2.0.2","description":"Eve Online Single Sign On (SSO)","main":"./dist/index.js","author":{"name":"Michiel van der Velde","email":"michiel@michielvdvelde.nl"},"homepage":"http://github.com/LakMoore/eve-sso","repository":{"type":"git","url":"git+https://github.com/LakMoore/eve-sso.git"},"engines":{"node":">=10"},"keywords":["eve","online","sso","esi"],"license":"MIT","dependencies":{"form-urlencoded":"^6.1.4","jsonwebtoken":"^9.0.2","jwks-rsa":"^3.1.0","node-fetch":"^2.7.0"},"devDependencies":{"@types/jsonwebtoken":"^9.0.5","@types/node-fetch":"^2.6.10"},"_id":"@after_ice/eve-sso@2.0.2","gitHead":"172a74cf7204fe5824f7f34feb6fe7dd75a39188","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/LakMoore/eve-sso/issues"},"_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-aAB5SXKE+pl6NsIdbz+2QxbB7adaPS62sKsIO6QyMO/nwS1v4AC7Q3FfvJOCsEUqKcZgn6WfGN0l5JBaIS1TMQ==","shasum":"82bfb4c9bc06d18fc579a7d1877525dc6c8e9b63","tarball":"https://registry.npmjs.org/@after_ice/eve-sso/-/eve-sso-2.0.2.tgz","fileCount":5,"unpackedSize":10067,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGCzoV3u3DfmcY1lc3CId7OVwDeRGzE+DZB4VpiKqWDSAiEAwsTg0zW+4epCs9PqP25O7MobI1TatFuCIVzrJ/4zag8="}]},"_npmUser":{"name":"lak_moore","email":"stuart@equipmyschool.com"},"directories":{},"maintainers":[{"name":"lak_moore","email":"stuart@equipmyschool.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eve-sso_2.0.2_1705076453650_0.8809304529019222"},"_hasShrinkwrap":false}},"time":{"created":"2023-05-25T15:38:29.400Z","2.0.1":"2023-05-25T15:38:29.598Z","modified":"2024-01-12T16:20:54.018Z","2.0.2":"2024-01-12T16:20:53.792Z"},"maintainers":[{"name":"lak_moore","email":"stuart@equipmyschool.com"}],"description":"Eve Online Single Sign On (SSO)","homepage":"http://github.com/LakMoore/eve-sso","keywords":["eve","online","sso","esi"],"repository":{"type":"git","url":"git+https://github.com/LakMoore/eve-sso.git"},"author":{"name":"Michiel van der Velde","email":"michiel@michielvdvelde.nl"},"bugs":{"url":"https://github.com/LakMoore/eve-sso/issues"},"license":"MIT","readme":"# Eve Single Sign On\n\nVersion 2.0.1\n- Downgraded node-fetch to v2 for better Typescript compatibilily (CJS not ESM)\n- Added \"audience\" to the JWT verification\n- Added extra exception handling to JWT verification (authorisation calls at downtime used to crash)\n\n[Eve Online](https://eveonline.com) Single Sign On (SSO) module for node.js.\nOnce the user/character is authenticated, you can use the access token to make\nauthenticated requests to [ESI](https://docs.esi.evetech.net/docs/esi_introduction.html)\n(not included in this module).\n\nFor a more complete module which includes account, character, and token management\nas well as the ability to make unauthenticated and authenticated requests to ESI,\nsee my module [eve-esi-client](https://github.com/MichielvdVelde/eve-esi).\n\n> See the [Eve Online developer documentation](https://docs.esi.evetech.net/docs/sso/)\n> for more information\n\n## Install\n\n```\nnpm i eve-sso [--save]\n```\n\n## Example\n\nBefore using the module you must create an application in the\n[Eve Online developers section](https://developers.eveonline.com/). This will\ngive you the required client ID and secret.\n\nA small example using koa.\n\n```ts\nimport SingleSignOn from './index'\nimport Koa from 'koa'\nimport Router from 'koa-router'\n\n// Get the client ID and secret from the Eve developers section\nconst CLIENT_ID = 'your client id'\nconst SECRET = 'your secret'\n// The callback URI as defined in the application in the developers section\nconst CALLBACK_URI = 'http://localhost:3001/sso'\n\nconst sso = new SingleSignOn(CLIENT_ID, SECRET, CALLBACK_URI, {\n  endpoint: 'https://login.eveonline.com', // optional, defaults to this\n  userAgent: 'my-user-agent' // optional\n})\n\nconst app = new Koa()\nconst router = new Router()\n\n// Show a login redirect link\nrouter.get('/login', async ctx => {\n  // The first argument is a required state, which you can verify in the callback\n  // The second argument is an optional space-delimited string or string array of scopes to request\n  ctx.body = `<a href=\"${sso.getRedirectUrl('my-state')}\">Login to Eve Online</a>`\n})\n\n// Handle the SSO callback (this route is the CALLBACK_URI above)\nrouter.get('/sso', async ctx => {\n  // Get the one-time access code\n  const code: string = ctx.query.code\n  // NOTE: usually you'd want to validate the state (ctx.query.state) as well\n\n  // Swap the one-time code for an access token\n  const info = await sso.getAccessToken(code)\n\n  // Usually you'd want to store the access token\n  // as well as the refresh token\n  console.log('info', info)\n  \n  // Do whatever, for example, redirect to user page\n  ctx.body = 'You are now authenticated!'\n})\n\napp.use(router.middleware())\napp.listen(3001, () => {\n  console.log('Server listening on port 3001')\n})\n\n```\n\n## License\n\nCopyright 2020-2021 Michiel van der Velde.\n\nThis software is licensed under [the MIT License](LICENSE).\n","readmeFilename":"README.md"}