{"_id":"@briebug/passport-custom","_rev":"3-fa1025de4dbb43e111a1070125662336","name":"@briebug/passport-custom","dist-tags":{"latest":"1.3.0"},"versions":{"1.3.0":{"name":"@briebug/passport-custom","version":"1.3.0","keywords":["passport","custom","auth","authn","authentication"],"author":{"name":"Mike Bell","email":"mbell8903@yahoo.com"},"license":"MIT","_id":"@briebug/passport-custom@1.3.0","maintainers":[{"name":"schuchard","email":"schuchard.kevin@gmail.com"},{"name":"inorganik","email":"jamie.perkins@gmail.com"},{"name":"jrista","email":"jon.rista@briebug.com"},{"name":"anthonyjones0519","email":"anthonyjones0519@gmail.com"}],"homepage":"https://github.com/mbell8903/passport-custom","bugs":{"url":"http://github.com/mbell8903/passport-custom/issues"},"dist":{"shasum":"05adeed19806250dd8b5700951b0faadf763a1e6","tarball":"https://registry.npmjs.org/@briebug/passport-custom/-/passport-custom-1.3.0.tgz","fileCount":6,"integrity":"sha512-zDl4cUTWIZOUZA213IYAF5664HBKGL8ifubZoB6iP3MJAMcT8CIGK+tLszPfF0xniTM1lJpLrwQ2xeXuBGqXvA==","signatures":[{"sig":"MEUCIHaJF1gyW9ZbVRc0/X+BjTP7KIVj+wFNe+UnP/vZgp4wAiEA3O/rWByCH0n122sX+mNVNDcDOzZ+sYlXaJO4jJsLoi8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7127,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj1B85ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQjg/+PejriGSVjQJivH0jY0hnbB/IcbwsomVdlsKZeQnWWmG5227c\r\nCr74hTcYHIQ0ixY8wbaQGHbD0SdDV1iL+j8Ky7L0C08KxZg2AdGxiKIPWxJs\r\nCtWwU/uPI20UY3ka1HWIC02XtrHmB3TM+n9vjIX64MeNs7RDvDru+eGdiClR\r\nChDVyNxqZIGhYJk/HaI51uZ6GfLsiRNKZXwuitTQrGbYFoBlLJZ7N6VdLPFr\r\nAyJPhR66zR0aDKCwh8A4UQFsDqsA2CyMEjYp8oKZF0syEHeqkzEzzrK+UcBo\r\nvfJO2UrhJacdoKx0qanq3ycILOZIFkeuIkZX+0+KFB510ByRNlryajD0cUdO\r\nd9sfzYHrYNzABl+/ImNHgXR54V1bkJ2L1g+F9yVOABZP4eJ22xfFNAneseIX\r\n9ntXnh8mCSOBqrjTqQR8ay5l0oWPKIiFhE5ItL41C6nQuJ7yaQhkpBiOEVn8\r\nVRicyQe6gfgFluWREC8pOXdknf7Uogvjnow2IlBZEV62nqGyY+RD4QC1Do2F\r\n2so4y5G1s+QQfblNcBDbs3rc8oZuyb0msMCjD9djKTWBHAPWxy6ivcUuhxwp\r\nv33wBrWP04+WA+qImzJBPyzVK5MqTTTf2QwXWdGlTjrRJhgEIuK75CS9vkob\r\npj6REmaYpA4LuHRG58RQNB9v2bXLtjYpHEE=\r\n=cVbQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib","engines":{"node":">= 0.10.0"},"gitHead":"b7bacc411903b37c5037beaeb54f597ba7d8d9ba","scripts":{"test":"mocha --reporter spec --require test/bootstrap/node test/*.test.js"},"typings":"./lib/index.d.ts","_npmUser":{"name":"jrista","email":"jon.rista@briebug.com"},"licenses":[{"url":"http://www.opensource.org/licenses/MIT","type":"MIT"}],"repository":{"url":"git://github.com/briebug/passport-custom.git","type":"git"},"_npmVersion":"6.14.15","description":"Custom authentication strategy for Passport (supports @nestjs/passport).","directories":{"test":"test","example":"examples"},"_nodeVersion":"14.17.6","dependencies":{"passport-strategy":"1.x.x"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^2.1.0","mocha":"^2.1.0","chai-passport-strategy":"0.1.x"},"_npmOperationalInternal":{"tmp":"tmp/passport-custom_1.3.0_1674846009628_0.03792727917079941","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-01-27T19:00:09.554Z","modified":"2026-01-31T15:55:43.087Z","1.3.0":"2023-01-27T19:00:09.793Z"},"bugs":{"url":"http://github.com/mbell8903/passport-custom/issues"},"author":{"name":"Mike Bell","email":"mbell8903@yahoo.com"},"license":"MIT","homepage":"https://github.com/mbell8903/passport-custom","keywords":["passport","custom","auth","authn","authentication"],"repository":{"url":"git://github.com/briebug/passport-custom.git","type":"git"},"description":"Custom authentication strategy for Passport (supports @nestjs/passport).","maintainers":[{"email":"schuchard.kevin@gmail.com","name":"schuchard"},{"email":"anthonyjones0519@gmail.com","name":"anthonyjones0519"},{"email":"jesse.sanders@briebug.com","name":"jessesanders"}],"readme":"# passport-custom\n\n[![Build](https://travis-ci.org/mbell8903/passport-custom.png)](https://travis-ci.org/mbell8903/passport-custom)\n[![Coverage Status](https://coveralls.io/repos/mbell8903/passport-custom/badge.png)](https://coveralls.io/r/mbell8903/passport-custom)\n[![Quality](https://codeclimate.com/github/mbell8903/passport-custom.png)](https://codeclimate.com/github/mbell8903/passport-custom)\n[![Dependencies](https://david-dm.org/mbell8903/passport-custom.png)](https://david-dm.org/mbell8903/passport-custom)\n\n\n[Passport](http://passportjs.org/) strategy for authenticating with custom logic.\n\nThis module lets you authenticate using custom logic in your Node.js\napplications. It is based on passport-local module by Jared Hanson.\nBy plugging into Passport, custom authentication can be easily and\nunobtrusively integrated into any application or framework that supports\n[Connect](http://www.senchalabs.org/connect/)-style middleware, including\n[Express](http://expressjs.com/).\n\n## Install\n\n    $ npm install passport-custom\n\n## Usage\n\n#### Configure Strategy\n\nThe custom authentication strategy authenticates users by custom logic of your choosing.\nThe strategy requires a `verify` callback, which is where the custom logic goes and calls\n`done` providing a user. Note that, req is always passed as the first parameter to the \n`verify` callback.\n\nHere is the pseudo code:\n\n```javascript\nimport passportCustom from 'passport-custom';\nconst CustomStrategy = passportCustom.Strategy;\n\npassport.use('strategy-name', new CustomStrategy(\n  {},\n  function(req, callback) {\n    // Do your custom user finding logic here, or set to false based on req object\n    callback(null, user);\n  }\n));\n```\n\nAnd a basic example:\n\n```javascript\npassport.use(new CustomStrategy(\n  function(req, done) {\n    User.findOne({\n      username: req.body.username\n    }, function (err, user) {\n      done(err, user);\n    });\n  }\n));\n```\n\n#### Authenticate Requests\n\nUse `passport.authenticate()`, specifying the `'custom'` strategy (or whatever you named the strategy upon registration), to\nauthenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/)\napplication:\n\n```javascript\napp.post('/login',\n  passport.authenticate('custom', { failureRedirect: '/login' }),\n  function(req, res) {\n    res.redirect('/');\n  }\n);\n```\n\n## Tests\n\n    $ npm install\n    $ npm test\n\n## Credits\n\n  - [Mike Bell](http://github.com/mbell8903)\n\n## License\n\n[The MIT License](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2014-2015 Mike Bell\n","readmeFilename":"README.md"}