{"_id":"@blackspark/passport-local-restify","_rev":"1-8e2301cba8acf35e53030095ace22e23","name":"@blackspark/passport-local-restify","description":"Local username and password authentication strategy for Passport/Restify.","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@blackspark/passport-local-restify","version":"1.0.0","description":"Local username and password authentication strategy for Passport/Restify.","keywords":["passport","local","auth","authn","authentication","username","password"],"author":{"name":"Jared Hanson","email":"jaredhanson@gmail.com","url":"http://www.jaredhanson.net/"},"repository":{"type":"git","url":"git://github.com/jaredhanson/passport-local.git"},"bugs":{"url":"http://github.com/jaredhanson/passport-local/issues"},"license":"MIT","licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"main":"./lib","dependencies":{"passport-strategy":"1.x.x"},"devDependencies":{"mocha":"1.x.x","chai":"1.x.x","chai-passport-strategy":"0.1.x"},"engines":{"node":">= 0.4.0"},"scripts":{"test":"mocha --reporter spec --require test/bootstrap/node test/*.test.js"},"homepage":"https://github.com/jaredhanson/passport-local#readme","directories":{"lib":"lib","test":"test"},"gitHead":"64ea410fc6e80b297b8afd9ce78a76cccd506e28","_id":"@blackspark/passport-local-restify@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"crbaptiste","email":"admin@blacksparkcorp.com"},"dist":{"integrity":"sha512-NTOupsSCT5j/I0JwM6dFinkvgxAASQnHcalmKCg03HxbSdITROFPQqBHwDP2TMWmVcaJBet4oPDeFT4mGxrXCA==","shasum":"76f4fa0b48814b933c3a64acc80a4aa0a230e7fb","tarball":"https://registry.npmjs.org/@blackspark/passport-local-restify/-/passport-local-restify-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHqONFk3DSZQhN2peIjVpsnjPoMUpTXAWNoTD6Ck8DivAiEAgXDrXPMBCHlSdSVGULFvXDWr1v5+hScBcb+C+0EKa4c="}]},"maintainers":[{"name":"crbaptiste","email":"admin@blacksparkcorp.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport-local-restify-1.0.0.tgz_1513793687875_0.23573940456844866"}}},"readme":"# passport-local\n\n[![Build](https://travis-ci.org/jaredhanson/passport-local.png)](https://travis-ci.org/jaredhanson/passport-local)\n[![Coverage](https://coveralls.io/repos/jaredhanson/passport-local/badge.png)](https://coveralls.io/r/jaredhanson/passport-local)\n[![Quality](https://codeclimate.com/github/jaredhanson/passport-local.png)](https://codeclimate.com/github/jaredhanson/passport-local)\n[![Dependencies](https://david-dm.org/jaredhanson/passport-local.png)](https://david-dm.org/jaredhanson/passport-local)\n[![Tips](http://img.shields.io/gittip/jaredhanson.png)](https://www.gittip.com/jaredhanson/)\n\n\n[Passport](http://passportjs.org/) strategy for authenticating with a username\nand password.\n\nThis module lets you authenticate using a username and password in your Node.js\napplications.  By plugging into Passport, local 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```bash\n$ npm install passport-local\n```\n\n## Usage\n\n#### Configure Strategy\n\nThe local authentication strategy authenticates users using a username and\npassword.  The strategy requires a `verify` callback, which accepts these\ncredentials and calls `done` providing a user.\n\n```js\npassport.use(new LocalStrategy(\n  function(username, password, done) {\n    User.findOne({ username: username }, function (err, user) {\n      if (err) { return done(err); }\n      if (!user) { return done(null, false); }\n      if (!user.verifyPassword(password)) { return done(null, false); }\n      return done(null, user);\n    });\n  }\n));\n```\n\n##### Available Options\n\nThis strategy takes an optional options hash before the function, e.g. `new LocalStrategy({/* options */, callback})`.\n\nThe available options are:\n\n* `usernameField` - Optional, defaults to 'username'\n* `passwordField` - Optional, defaults to 'password'\n\nBoth fields define the name of the properties in the POST body that are sent to the server.\n\n#### Parameters\n\nBy default, `LocalStrategy` expects to find credentials in parameters\nnamed username and password. If your site prefers to name these fields\ndifferently, options are available to change the defaults.\n\n    passport.use(new LocalStrategy({\n        usernameField: 'email',\n        passwordField: 'passwd',\n        session: false\n      },\n      function(username, password, done) {\n        // ...\n      }\n    ));\n\nWhen session support is not necessary, it can be safely disabled by\nsetting the `session` option to false.\n\nThe verify callback can be supplied with the `request` object by setting\nthe `passReqToCallback` option to true, and changing callback arguments\naccordingly.\n\n    passport.use(new LocalStrategy({\n        usernameField: 'email',\n        passwordField: 'passwd',\n        passReqToCallback: true,\n        session: false\n      },\n      function(req, username, password, done) {\n        // request object is now first argument\n        // ...\n      }\n    ));\n\n#### Authenticate Requests\n\nUse `passport.authenticate()`, specifying the `'local'` strategy, to\nauthenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/)\napplication:\n\n```js\napp.post('/login', \n  passport.authenticate('local', { failureRedirect: '/login' }),\n  function(req, res) {\n    res.redirect('/');\n  });\n```\n\n## Examples\n\nDevelopers using the popular [Express](http://expressjs.com/) web framework can\nrefer to an [example](https://github.com/passport/express-4.x-local-example)\nas a starting point for their own web applications.\n\nAdditional examples can be found on the [wiki](https://github.com/jaredhanson/passport-local/wiki/Examples).\n\n## Tests\n\n```bash\n$ npm install\n$ npm test\n```\n\n## Credits\n\n- [Jared Hanson](http://github.com/jaredhanson)\n\n## License\n\n[The MIT License](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2011-2015 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>\n\n<a target='_blank' rel='nofollow' href='https://app.codesponsor.io/link/vK9dyjRnnWsMzzJTQ57fRJpH/jaredhanson/passport-local'>  <img alt='Sponsor' width='888' height='68' src='https://app.codesponsor.io/embed/vK9dyjRnnWsMzzJTQ57fRJpH/jaredhanson/passport-local.svg' /></a>\n","maintainers":[{"name":"crbaptiste","email":"admin@blacksparkcorp.com"}],"time":{"modified":"2022-04-04T19:22:28.865Z","created":"2017-12-20T18:14:47.939Z","1.0.0":"2017-12-20T18:14:47.939Z"},"homepage":"https://github.com/jaredhanson/passport-local#readme","keywords":["passport","local","auth","authn","authentication","username","password"],"repository":{"type":"git","url":"git://github.com/jaredhanson/passport-local.git"},"author":{"name":"Jared Hanson","email":"jaredhanson@gmail.com","url":"http://www.jaredhanson.net/"},"bugs":{"url":"http://github.com/jaredhanson/passport-local/issues"},"license":"MIT","readmeFilename":"README.md"}