{"_id":"actionhero-oauth2-provider","_rev":"33-3345fdab850288ab224b6d50419370ba","name":"actionhero-oauth2-provider","description":"ActionHero OAuth2 Provider","dist-tags":{"latest":"2.0.1"},"versions":{"0.1.0":{"name":"actionhero-oauth2-provider","version":"0.1.0","description":"ActionHero OAuth2 Provider","homepage":"","author":{"name":"Philipp Waldmann"},"main":"./lib","dependencies":{"oauth2-provider":">=1.3.x"},"devDependencies":{},"_id":"actionhero-oauth2-provider@0.1.0","dist":{"shasum":"a5571092a1e66d5c24eb4bb4fca5cb5e0bbccc0b","tarball":"https://registry.npmjs.org/actionhero-oauth2-provider/-/actionhero-oauth2-provider-0.1.0.tgz","integrity":"sha512-2s/sjaQm77a9pB16LJB1NLbIaxY6ITCel+rZk5ZPTfUFwlAb73i14XgzXjqLdlZ8CVBt6jUEP780xKRkEk8KIw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVD3iBc0r1RY+gapra4JrHUpOUBADIUL0aCp/HbTVdhwIhAPGjdaWTHYK2QvRmMtiDymLfhtcZiFsSFLMoDVG/imCZ"}]},"_from":".","_npmVersion":"1.3.22","_npmUser":{"name":"philw","email":"philipp.waldmann@s-team.at"},"maintainers":[{"name":"philw","email":"philipp.waldmann@s-team.at"}]},"1.0.0":{"name":"actionhero-oauth2-provider","version":"1.0.0","description":"ActionHero OAuth2 Provider","keywords":["actionhero","oauth2","provider"],"author":{"name":"Philipp Waldmann","email":"philipp.waldmann@s-team.at"},"repository":{"type":"git","url":"git://github.com/s-team/actionhero-oauth2-provider.git"},"main":"./lib","dependencies":{"oauth2-provider":">=1.3.x"},"devDependencies":{},"bugs":{"url":"https://github.com/s-team/actionhero-oauth2-provider/issues"},"_id":"actionhero-oauth2-provider@1.0.0","dist":{"shasum":"de7006365e07f4fce4e763d6a03406b04497dc2d","tarball":"https://registry.npmjs.org/actionhero-oauth2-provider/-/actionhero-oauth2-provider-1.0.0.tgz","integrity":"sha512-R6u+d5lJ+P4ugOasB6zj9xNjPubr6l3Caur8+Q/CgZV158CWu0p4gaBV0polDYfx0s9HSx4DwvZ5Ijmd4VD++A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCd7ZD6mXttsUiaLAGdBuGUTm5cOoqesBmGiFlLQmJz0QIhAOxBh3RIlUTu5FuVG7DHaEaVKUplPpqbGtjoJsQCIQTV"}]},"_from":".","_npmVersion":"1.2.21","_npmUser":{"name":"philw","email":"philipp.waldmann@s-team.at"},"maintainers":[{"name":"philw","email":"philipp.waldmann@s-team.at"}]},"1.0.1":{"name":"actionhero-oauth2-provider","version":"1.0.1","description":"ActionHero OAuth2 Provider","keywords":["actionhero","oauth2","provider"],"author":{"name":"Philipp Waldmann","email":"philipp.waldmann@s-team.at"},"repository":{"type":"git","url":"git://github.com/s-team/actionhero-oauth2-provider.git"},"main":"./lib","dependencies":{"oauth2-provider":">=1.3.x"},"devDependencies":{},"bugs":{"url":"https://github.com/s-team/actionhero-oauth2-provider/issues"},"_id":"actionhero-oauth2-provider@1.0.1","dist":{"shasum":"9b1be17c1d0bdeeeb6c3855f03847f6f20b453af","tarball":"https://registry.npmjs.org/actionhero-oauth2-provider/-/actionhero-oauth2-provider-1.0.1.tgz","integrity":"sha512-MRxFdGqcsN94J2Qu2XGYh9TqqeWrmbkTIcKYP86HoRkWCBFCQDRN7N4myk2f+cp16A/iC2l+37RlQPxs19N5XA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHB33WeN6/GMDThXyXuRFBDsV22EAd8W8e7ccNM21PUCAiEA+lRr7xcZit5MIbLTJIOKb1/tynI75EM/HIfKE5hp0+4="}]},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"philw","email":"philipp.waldmann@s-team.at"},"maintainers":[{"name":"philw","email":"philipp.waldmann@s-team.at"}]},"1.0.2":{"name":"actionhero-oauth2-provider","version":"1.0.2","description":"ActionHero OAuth2 Provider","keywords":["actionhero","oauth2","provider"],"author":{"name":"Philipp Waldmann","email":"philipp.waldmann@s-team.at"},"repository":{"type":"git","url":"git://github.com/s-team/actionhero-oauth2-provider.git"},"main":"./lib","dependencies":{"oauth2-provider":">=1.3.x"},"devDependencies":{},"bugs":{"url":"https://github.com/s-team/actionhero-oauth2-provider/issues"},"homepage":"https://github.com/s-team/actionhero-oauth2-provider","_id":"actionhero-oauth2-provider@1.0.2","dist":{"shasum":"c6aba1e419d670ad07e846f45bd2334b34063a19","tarball":"https://registry.npmjs.org/actionhero-oauth2-provider/-/actionhero-oauth2-provider-1.0.2.tgz","integrity":"sha512-m6mt3oDdCEsffNuOdrBK8b+D90d7muRumU26zXkhAdaUfP+5AuwEeJpaem84NvL4Tv/eed0jySTp5RIWck8sqQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQApVHcbBHHhptvAke89G55+f7Ae3NnA0LFAn7A/EvQQIhAP/UvLEH/EWetN7epVTExrT5GXPbCZAblKGLjkRSrwEK"}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"philw","email":"philipp.waldmann@s-team.at"},"maintainers":[{"name":"philw","email":"philipp.waldmann@s-team.at"}]},"1.0.3":{"name":"actionhero-oauth2-provider","version":"1.0.3","description":"ActionHero OAuth2 Provider","keywords":["actionhero","oauth2","provider"],"author":{"name":"Philipp Waldmann","email":"philipp.waldmann@s-team.at"},"repository":{"type":"git","url":"git://github.com/s-team/actionhero-oauth2-provider.git"},"main":"./lib","dependencies":{"oauth2-provider":">=1.3.x"},"devDependencies":{},"bugs":{"url":"https://github.com/s-team/actionhero-oauth2-provider/issues"},"homepage":"https://github.com/s-team/actionhero-oauth2-provider","_id":"actionhero-oauth2-provider@1.0.3","dist":{"shasum":"61eac8093823f85bf3cf18b971b7ba4d25420e26","tarball":"https://registry.npmjs.org/actionhero-oauth2-provider/-/actionhero-oauth2-provider-1.0.3.tgz","integrity":"sha512-AU0+sEQY8f9yHAorIwkzQQ2HzmlhwGj2qNk8L++iAcwRUIvvPQ89++zIqOZVMqPow710Plao5hZgF7YG7xlQng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIALoen6H+MpevL4d+1XiiOvjb7zNMouuJB8tf5gnkTNeAiBGop3XnJ/vLmTKSRn9LATNPME1m15EXXQTAAKAAs8oOw=="}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"philw","email":"philipp.waldmann@s-team.at"},"maintainers":[{"name":"philw","email":"philipp.waldmann@s-team.at"}]},"1.0.4":{"name":"actionhero-oauth2-provider","version":"1.0.4","description":"ActionHero OAuth2 Provider","keywords":["actionhero","oauth2","provider"],"author":{"name":"Philipp Waldmann","email":"philipp.waldmann@s-team.at"},"repository":{"type":"git","url":"git://github.com/s-team/actionhero-oauth2-provider.git"},"main":"./lib","dependencies":{"oauth2-provider":">=1.3.x"},"devDependencies":{},"bugs":{"url":"https://github.com/s-team/actionhero-oauth2-provider/issues"},"homepage":"https://github.com/s-team/actionhero-oauth2-provider","_id":"actionhero-oauth2-provider@1.0.4","dist":{"shasum":"4a351ad9a4fe3b54dae2db78a5c5057fc7624ede","tarball":"https://registry.npmjs.org/actionhero-oauth2-provider/-/actionhero-oauth2-provider-1.0.4.tgz","integrity":"sha512-aRX49eb2HFH2eRn9QnCG3d43fl/VJYNWoFJq3a8TO8sx6yV4vrhusu3cdgvlAPAnI1Vl8+cxhjzUDUpAbFrT6g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFbKDTjDr6Bf3QJrVDICmmT1lFlV85VAVtx2xAPRekY+AiEA+vEFfepd82OK0EGXnlG1JzqMalwSFAczLRmO7M/bPAE="}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"philw","email":"philipp.waldmann@s-team.at"},"maintainers":[{"name":"philw","email":"philipp.waldmann@s-team.at"}]},"1.0.5":{"name":"actionhero-oauth2-provider","version":"1.0.5","description":"ActionHero OAuth2 Provider","keywords":["actionhero","oauth2","provider"],"author":{"name":"Philipp Waldmann","email":"philipp.waldmann@s-team.at"},"repository":{"type":"git","url":"git://github.com/s-team/actionhero-oauth2-provider.git"},"main":"./lib","dependencies":{"oauth2-provider":">=1.3.x"},"devDependencies":{},"bugs":{"url":"https://github.com/s-team/actionhero-oauth2-provider/issues"},"homepage":"https://github.com/s-team/actionhero-oauth2-provider","_id":"actionhero-oauth2-provider@1.0.5","dist":{"shasum":"2c1592fd24ea181e1aa4173d52182eee217ebc0f","tarball":"https://registry.npmjs.org/actionhero-oauth2-provider/-/actionhero-oauth2-provider-1.0.5.tgz","integrity":"sha512-wbHWN8u2PUkyhJJJ3ULBx9viCh4GFqfTRmgQzrf5pN1u6gtarlHDhcCGaAwtehWFKqFSt7NDnYeCDbzD/3xKNw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGzbNC9xkPaHSbOsasiCl1YBHbzOuxetkWfhpQCgbJ9IAiEA6ZRnT7xDO0KZ9+AMKN4l/eHcVwO6gb+hE9fjy+kiWqE="}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"philw","email":"philipp.waldmann@s-team.at"},"maintainers":[{"name":"philw","email":"philipp.waldmann@s-team.at"}]},"2.0.0":{"name":"actionhero-oauth2-provider","version":"2.0.0","description":"ActionHero OAuth2 Provider","keywords":["actionhero","oauth2","provider"],"author":{"name":"Philipp Waldmann","email":"philipp.waldmann@s-team.at"},"repository":{"type":"git","url":"git://github.com/s-team/actionhero-oauth2-provider.git"},"main":"./lib","dependencies":{"oauth2-provider":">=1.3.x"},"devDependencies":{},"gitHead":"ff23b83825c25e79e9a89ee4089212c2c862b37c","bugs":{"url":"https://github.com/s-team/actionhero-oauth2-provider/issues"},"homepage":"https://github.com/s-team/actionhero-oauth2-provider","_id":"actionhero-oauth2-provider@2.0.0","scripts":{},"_shasum":"f3afd77d45dc55b10d749bc53241e5aa4451ce71","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"philw","email":"philipp.waldmann@s-team.at"},"maintainers":[{"name":"philw","email":"philipp.waldmann@s-team.at"}],"dist":{"shasum":"f3afd77d45dc55b10d749bc53241e5aa4451ce71","tarball":"https://registry.npmjs.org/actionhero-oauth2-provider/-/actionhero-oauth2-provider-2.0.0.tgz","integrity":"sha512-GnhYUy3zkAcstFXLqADaEmj6r3UE967V2rCmTcLH+W5hIfoJQFatLW9P+vm7BRDK457wGjpiEr7UwO96LYlgOQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQqA16PAt++qIcj61GzRClrlpEjfkVg9XfEN4UKCAsTwIhAMIIuwiZu8tUR8gDbr0Mh9mHXriiqVMakqP2Gs00YkHQ"}]}},"2.0.1":{"name":"actionhero-oauth2-provider","version":"2.0.1","description":"ActionHero OAuth2 Provider","keywords":["actionhero","oauth2","provider"],"author":{"name":"Philipp Waldmann","email":"philipp.waldmann@s-team.at"},"repository":{"type":"git","url":"git://github.com/s-team/actionhero-oauth2-provider.git"},"main":"./lib","dependencies":{"oauth2-provider":">=1.3.x"},"devDependencies":{},"gitHead":"ba1f2d019698180eddc974de9d1bd2e59737e3ee","bugs":{"url":"https://github.com/s-team/actionhero-oauth2-provider/issues"},"homepage":"https://github.com/s-team/actionhero-oauth2-provider","_id":"actionhero-oauth2-provider@2.0.1","scripts":{},"_shasum":"a2e85bdcc208fdcbdc1e2894008ca0136b419d14","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"philw","email":"philipp.waldmann@s-team.at"},"maintainers":[{"name":"philw","email":"philipp.waldmann@s-team.at"}],"dist":{"shasum":"a2e85bdcc208fdcbdc1e2894008ca0136b419d14","tarball":"https://registry.npmjs.org/actionhero-oauth2-provider/-/actionhero-oauth2-provider-2.0.1.tgz","integrity":"sha512-HPn2Pxexfnn0mxpZS6+S1QTSGwVjbF6owllaoOqwpFGcyMhYReFesaY/sMpC4yx6kgwcZRfW6CBPI40ZsVXUbg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKmW9cD2bqBR8r08oj2WYND48jAWo2kqy3Qkh35bJO1AIgAOQTIfNWvJt54ikBkjQb/gDYWVRQAfL5FzgpxKnRzhM="}]}}},"readme":"# actionhero OAuth2 provider\n\nCreate a OAuth2 provider/server with actionhero\n\nInstall: \n```bash\nnpm install actionhero-oauth2-provider\n```\n\ncreate a new initializer inside your actionhero project.\n\ne.g. `oauth2.js` with the following content\n```js\nvar OAuth2Provider = require('actionhero-oauth2-provider');\n\nvar provider = new OAuth2Provider(); \n\n\n\nprovider.on('validate_user', function(api, connection, next){\n  var authorize_url = connection.params.authorize_url;\n  if(/*the user is logged in.*/){\n    next();\n  }else{\n    //redirect to the login page\n    res.writeHead(303, {Location: '/login'});\n    res.end();\n    next(false);\n  }\n});\n\n\n\nprovider.on('validate_client', function(api, connection, next){\n  var client_id = connection.params.client_id;\n  \n  if(/*client_id valid?*/){\n    next();\n  }else{\n    connection.error = 'invalid client id!';\n    next(false);\n  }\n});\n\n\nprovider.on('validate_grant', function(api, connection, next){\n  var client_id = connection.params.client_id;\n  var user_id = connection.session.user_id;\n  \n  if(/*grants exists?*/){\n    next();\n  }else{\n    //redirect\n    res.writeHead(303, {Location: '/grant'});\n    res.end();\n    next(false);\n  }\n});\n\n\nprovider.on('validate_code', function(api, connection, next){\n  var client_id = connection.params.client_id;\n  var code = connection.params.code;\n  \n  if(/*code is valid?*/){\n    next();\n  }else{\n    connection.error = 'invalid code!';\n    next(false);\n  }\n});\n\n\nprovider.on('validate_access_token', function(api, connection, next){\n  var client_id = connection.params.client_id;\n  var access_token = connection.params.access_token;\n  \n  if(/*access_token is valid?*/){\n    //set session variables here if needed\n    next();\n  }else{\n    connection.error = 'invalid access_token!';\n    next(false);\n  }\n});\n\n\n\n\nprovider.on('save_code', function(api, connection, next){\n  var user_id = connection.session.user_id;\n  var client_id = connection.params.client_id;\n  var code = connection.params.code;\n  \n  //save code here\n  next();\n});\n\n\nprovider.on('destroy_code', function(api, connection, next){\n  var client_id = connection.params.client_id;\n  var code = connection.params.code;\n  \n  //destroy code here\n  next();\n});\n\n\n\nprovider.on('save_access_token', function(api, connection, next){\n  var client_id = connection.params.client_id;\n  var code = connection.params.code;\n  var access_token = connection.params.access_token;\n  \n  //save access_token here\n  next();\n});\n\n\n//export the initializer for actionhero\nexports.oauth2 = provider.initializer;\n```","maintainers":[{"email":"npm@s-team.at","name":"s-team"},{"email":"philipp@wu-server.com","name":"philw"}],"time":{"modified":"2022-06-13T02:23:29.738Z","created":"2014-01-24T11:59:25.718Z","0.1.0":"2014-01-24T11:59:25.718Z","1.0.0":"2014-02-16T15:14:21.475Z","1.0.1":"2014-02-19T12:22:50.323Z","1.0.2":"2014-06-04T11:40:54.353Z","1.0.3":"2014-06-12T13:07:43.089Z","1.0.4":"2014-06-12T13:30:51.321Z","1.0.5":"2014-06-12T14:36:35.731Z","2.0.0":"2014-07-10T09:33:18.653Z","2.0.1":"2014-07-11T09:17:07.110Z"},"readmeFilename":"README.md","author":{"name":"Philipp Waldmann","email":"philipp.waldmann@s-team.at"},"repository":{"type":"git","url":"git://github.com/s-team/actionhero-oauth2-provider.git"},"keywords":["actionhero","oauth2","provider"],"bugs":{"url":"https://github.com/s-team/actionhero-oauth2-provider/issues"},"homepage":"https://github.com/s-team/actionhero-oauth2-provider","users":{"benburwell":true,"peterkingsbury":true}}