{"_id":"@artsy/passport-local-with-otp","_rev":"15-16e3a1ef00891f3c340c4dea04738133","name":"@artsy/passport-local-with-otp","dist-tags":{"latest":"0.3.1","canary":"0.4.0-canary.13.71.0"},"versions":{"0.3.0":{"name":"@artsy/passport-local-with-otp","version":"0.3.0","keywords":["passport","local","auth","authn","authentication","username","password","otp"],"author":{"url":"https://www.artsy.net","name":"Artsy Inc."},"license":"MIT","_id":"@artsy/passport-local-with-otp@0.3.0","maintainers":[{"name":"sweir27","email":"sweir27@gmail.com"},{"name":"zephraph","email":"zephraph@gmail.com"},{"name":"arjelks","email":"ashley.jelks@artsymail.com"},{"name":"artsy-engineering","email":"opensource@artsymail.com"},{"name":"erikdstock","email":"erik.d.stock@gmail.com"},{"name":"xtina-starr","email":"c.thompsonms@gmail.com"},{"name":"damassi","email":"damassi.pappas@gmail.com"},{"name":"anandaroop","email":"anandaroop.roy+npm@gmail.com"},{"name":"yuki24","email":"yk.nishijima@gmail.com"},{"name":"mzikherman","email":"mzikherman@gmail.com"},{"name":"oxaudo","email":"oxaudo@yahoo.com"},{"name":"eessex","email":"eve@artsymail.com"}],"contributors":[{"url":"https://artsy.github.io","name":"Artsy Engineering"},{"name":"Jared Hanson"}],"homepage":"https://github.com/artsy/passport-local-with-otp#readme","bugs":{"url":"https://github.com/artsy/passport-local-with-otp/issues"},"dist":{"shasum":"c27bf342ad0cff13378ace9caae7395bec3c46fd","tarball":"https://registry.npmjs.org/@artsy/passport-local-with-otp/-/passport-local-with-otp-0.3.0.tgz","fileCount":7,"integrity":"sha512-gzN4InPgDdtNLxmziTk9ZmrMAf41zCGxG0CP8Fm5Q5RxWZxBJt6FkCqfQeBhpihU2L74lvseDxi5LYI8mkdOdQ==","signatures":[{"sig":"MEUCIGRlKCJnG+NhRWI8FaWDCsSIeTCDqmlPjdOIzP6N91PzAiEAr65HYvpq0BxZftK3vfHNPwjoyHkPkrUvMIOdT93OKXY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesjeGCRA9TVsSAnZWagAAG3gP/jNl1epuh/20fWuHK8yl\n5+wD8oH4Q/CtM6whdA9vgT9t+3lpiS+ZQYvbEYaOmPSMqn+djs3kplaH5yWy\nRfCjGGsLBISGCjynbFgM7TZ4KZzPVa6Fm5XpE1YHt9my0v/ifCuF/NHeYoan\n0tEuY3Q3Scz3dHlTROYrX+Q4LFyPwPbQL4N4ZIrcemmWbgOS9Q08BHhLAaRC\na/+fs6M2l3qeaQq7MmN42rya1yjTCm9Gyp9dpTu3ud36uoQ48HuTYLmmz8KN\nOh5GeTAicSKjOhoWXfOqNahO5spk8ChzM8jVLp7Wg/0JcJb0iZK+UNvm8Vt4\nvnk9GwUVO/3Uhu9YMeZjiSrPqNFfg/iCNMKmW1pwVC+gTeoMri2C8V1hw1KN\n83xok2nAHRvBkXo8+xxsgeUDiMzNroXCwax4FUWNOSutd4TCdd9Yna/XFs5u\nEsMhmi7razAOJiatfynkV9GEfc82zsquEktD+xNO90M4L/C1/rNB2Uvqwuvk\nGBgqp5W+ljoRcd7GI6Y4UBkijgFlgBn3MEgK6++Jld+eOeHjkL8wgHg4aB8s\niKCWbQSV262R3ki9b80WkRNFNWe8GRMxsvOu6PwZ0Wf1YCq5H6GvQ7rkU9O5\n4LC+oPvq/R1Q8cwXW+CtVMFBv7SzYd8aQTxzCEQnKzpT8TN5q1we9htMRa/I\n+52X\r\n=Mh++\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib/index.js","engines":{"node":">= 0.4.0"},"gitHead":"b57daa2a0e06dc0fb669b00159b8474aa41b3632","scripts":{"test":"make test","prettier-write":"prettier --write {lib,test}/*.js"},"_npmUser":{"name":"anandaroop","email":"anandaroop.roy+npm@gmail.com"},"licenses":[{"url":"http://www.opensource.org/licenses/MIT","type":"MIT"}],"prettier":{"semi":false,"singleQuote":false,"bracketSpacing":true},"repository":{"url":"git://github.com/artsy/passport-local-with-otp.git","type":"git"},"_npmVersion":"6.13.4","description":"Local username, password and otp authentication strategy for Passport.","directories":{},"_nodeVersion":"12.16.1","dependencies":{"passport-strategy":"1.x.x"},"_hasShrinkwrap":false,"devDependencies":{"chai":"2.x.x","mocha":"2.x.x","prettier":"^2.0.5","make-node":"0.4.6","chai-passport-strategy":"0.1.x"},"_npmOperationalInternal":{"tmp":"tmp/passport-local-with-otp_0.3.0_1588737925609_0.6114616578064582","host":"s3://npm-registry-packages"}},"0.3.1":{"name":"@artsy/passport-local-with-otp","version":"0.3.1","keywords":["passport","local","auth","authn","authentication","username","password","otp"],"author":{"url":"https://www.artsy.net","name":"Artsy Inc."},"license":"MIT","_id":"@artsy/passport-local-with-otp@0.3.1","maintainers":[{"name":"anandaroop","email":"anandaroop.roy+npm@gmail.com"},{"name":"arjelks","email":"ashley.jelks@artsymail.com"},{"name":"artsy-engineering","email":"opensource@artsymail.com"},{"name":"damassi","email":"damassi.pappas@gmail.com"},{"name":"eessex","email":"eve@artsymail.com"},{"name":"erikdstock","email":"erik.d.stock@gmail.com"},{"name":"mzikherman","email":"mzikherman@gmail.com"},{"name":"oxaudo","email":"oxaudo@yahoo.com"},{"name":"sweir27","email":"sweir27@gmail.com"},{"name":"xtina-starr","email":"c.thompsonms@gmail.com"},{"name":"yuki24","email":"yk.nishijima@gmail.com"},{"name":"zephraph","email":"zephraph@gmail.com"}],"contributors":[{"url":"https://artsy.github.io","name":"Artsy Engineering"},{"name":"Jared Hanson"}],"homepage":"https://github.com/artsy/passport-local-with-otp#readme","bugs":{"url":"https://github.com/artsy/passport-local-with-otp/issues"},"dist":{"shasum":"db3844f54599d40c5c2b1215d0edd82c15845440","tarball":"https://registry.npmjs.org/@artsy/passport-local-with-otp/-/passport-local-with-otp-0.3.1.tgz","fileCount":9,"integrity":"sha512-xokjH9xoedoSk76lDgKjzjlsXNqU7cOZZyJg3Ds+253AIEN4LkoMlI5+qrwznzfbpG7tHZi3R0ddQSCF2omROg==","signatures":[{"sig":"MEUCIGoT6WBvIf6VNhg05CzP9b9JPzixZVT5Gyymh2TlHGbhAiEA1xssFbINeAMihDlYAeMV+tjJia2rU+q0JBTLLDSLo/o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18979,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevNyFCRA9TVsSAnZWagAAlSIQAI/0cYjOWWY4gMNtJMN/\nhq0A1548qKtoEnS0r+rIVV5YzKmLtoZkzYM4hay2VfV5LDnhw4XcE+KdSR61\nF1U1eRW9pOo/hFPVov7SSxlSTB7tahO7haV0HlJ0h4/QGQ5MAcD0p2ekJ7Gf\n2xL1aIh1k6gZOR6ugcwmplm/M7VTSTDMyTz12v6udgpFcXbSa1dZDOzd1fFD\npXAroQrRvlRbjZtj1OMfRNH+rkdOKO/vU4OVdgOfIW3iiyG+5jTZunwaHKJC\nVsEPB9fofKmcNwQSjd4UJX48cb0mdB86TTwJl/vtI5lqHt2jV0xSI/buJCos\nOgcQxas7ZdtZakWoUqgxZZ2C0uGzq7KVtMCanY8KPXWXsChe/tYsVYjIugwo\ne5oKH3lPGKhNF2k9MGs/HH4ughfskXTDJsmd5KIheaAbVv2jU1k6SFa0asTO\nU78FMSc9vPbhwKXJdUnTN3bRTXrO3RRGSHLsR+V0uQ/h+HbyHf3FVtyvl4zZ\ncN3TOuMk5RVf+AZ3L7GZYVqNE+WCn+YyMJhG9nVbqMx+PD7kCqcMeD3JfsrS\nqwR86JAvEwtOFS/OTqNqSEQCL7CVI7k4BTl/lyp1koLdgvFLfagnCXNjc6of\npStSsVyU3MjYCzccwUcczZaGpATaI+UgEaj+sIwvwWu6DIzeNGJO2vH6FSsK\nB37z\r\n=tywf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib/index.js","engines":{"node":">=10"},"gitHead":"883d61d3ed461462ec5389c0f34a2e3620da3c3c","scripts":{"test":"make test","prettier-write":"prettier --write {lib,test}/*.js"},"_npmUser":{"name":"artsy-engineering","email":"opensource@artsymail.com"},"licenses":[{"url":"http://www.opensource.org/licenses/MIT","type":"MIT"}],"prettier":{"semi":false,"singleQuote":false,"bracketSpacing":true},"repository":{"url":"git://github.com/artsy/passport-local-with-otp.git","type":"git"},"_npmVersion":"6.14.4","description":"Local username, password and otp authentication strategy for Passport.","directories":{},"_nodeVersion":"10.20.1","dependencies":{"passport-strategy":"1.x.x"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.0.0","mocha":"^7.0.0","prettier":"^2.0.5","make-node":"0.4.6","@artsy/auto-config":"^1.0.2","chai-passport-strategy":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/passport-local-with-otp_0.3.1_1589435525296_0.3891510433076888","host":"s3://npm-registry-packages"}},"0.3.2-canary.12.64.0":{"name":"@artsy/passport-local-with-otp","version":"0.3.2-canary.12.64.0","keywords":["passport","local","auth","authn","authentication","username","password","otp"],"author":{"url":"https://www.artsy.net","name":"Artsy Inc."},"license":"MIT","_id":"@artsy/passport-local-with-otp@0.3.2-canary.12.64.0","maintainers":[{"name":"artsy-engineering","email":"opensource@artsymail.com"},{"name":"erikdstock","email":"erik.d.stock@gmail.com"},{"name":"xtina-starr","email":"c.thompsonms@gmail.com"},{"name":"damassi","email":"damassi.pappas@gmail.com"},{"name":"anandaroop","email":"anandaroop.roy+npm@gmail.com"},{"name":"yuki24","email":"yk.nishijima@gmail.com"},{"name":"mzikherman","email":"mzikherman@gmail.com"},{"name":"oxaudo","email":"oxaudo@yahoo.com"},{"name":"eessex","email":"eve@artsymail.com"},{"name":"arjelks","email":"ashley.jelks@artsymail.com"},{"name":"zephraph","email":"npm@just-be.dev"},{"name":"sweir27","email":"sweir27@gmail.com"},{"name":"dblandin","email":"dblandin@gmail.com"},{"name":"icirellik","email":"icirellik@gmail.com"}],"contributors":[{"url":"https://artsy.github.io","name":"Artsy Engineering"},{"name":"Jared Hanson"}],"homepage":"https://github.com/artsy/passport-local-with-otp#readme","bugs":{"url":"https://github.com/artsy/passport-local-with-otp/issues"},"dist":{"shasum":"c5d1ec2883c31211e545b6bdfbb968c05669a0dc","tarball":"https://registry.npmjs.org/@artsy/passport-local-with-otp/-/passport-local-with-otp-0.3.2-canary.12.64.0.tgz","fileCount":9,"integrity":"sha512-GDr5bWDUU038wbpRgkq7W23RquenntO+SRssU1qRORcINWK9wmoOdlCQK67S2TaHRmetScqloB/iv/BasjFeFA==","signatures":[{"sig":"MEYCIQD9wasS78iDdmB/nIGLW2GRg7vYx8Y4qQ+esYyHd74oBwIhANJbZxG1goC8SPeZxKt6ni5gm3xZ1m7xz98w504Lqy12","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhs7+gCRA9TVsSAnZWagAAp1cP/iQCmHmR2XJGiKfwafsy\nGStMA+JOa8WERUkeZQUSr9Lafau9qu9sirxMDdD3SmZTOLgr3vhd2NtNzq+u\ntgj1OjzOPJZvM9nWEgoEyuj0SU7EKExpVebNRRoYvnmNX/yt03vnLIlifGp1\nSkKSpCJwGkxvUgAILpAM1taJkdMk6aqUbMbHpnyBaWBWquEJvuUO/fvuAPzs\nLMyO5Ii36XtJLLsmdnwRosDkGiu85Uin6N9fzRDJTaUdt4btZuIeGa5hHJTV\n7wiGLSPHBPszhliIuLRBFyuvzhAaBNNsdldmAmQOEl3FZTBdRps7yfVm0hfb\n3Ydhl9OXMQT8ufkw0k77yD586/mcAjvQkZWAEfIhR9T6kNfibAsrVbG8BSkQ\nrbS8OMtbAlijkR/1az1ulCijsfTpkjiRlaglVf05x5fLmP8KviSQFc+Ip4nH\njWc6iYEE/i5gptfIjJGbfMwPPMft4u2Hive3hFodjREFFV5IQWcIDtbisccW\n0IMFEzk/mMVhLV6/0z0OwMc/K4uQL6v/6xkQO8UmiKgMmdbqDWlw08HPjbgF\nisrMPCjnRiJx4Gvhsjhvt3x7qjaynsRhxXUKIye/WAEQW65U2O7jfJROtjrK\n7bPRYNYeXlVKo565FIzZw1nCOd1F8nxNj7Vt3fnSFseCfrphcidbWFXak8F3\nBC9i\r\n=OFpX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib/index.js","readme":"# passport-local-with-otp\n\n![build status](https://circleci.com/gh/artsy/passport-local-with-otp.svg?style=shield) ![npm version](https://badge.fury.io/js/%40artsy%2Fpassport-local-with-otp.svg)\n\n[Passport] strategy for authenticating with a username,\npassword and OTP.\n\nThis module lets you authenticate using a username, password and time-based\none-time password (OTP) in your Node.js applications.\n\nThis is a fork of https://github.com/jaredhanson/passport-local, adapted for the\nuse case of submitting username, password and otp in unison to an upstream\nserver for authentication and second-factor verification in a single request.\n\n## Meta\n\n- **State:** production\n- **GitHub:** https://github.com/artsy/passport-local-with-otp\n- **CI:** [CircleCI]\n- **NPM:** New versions of [@artsy/passport-local-with-otp][npm_package] are published on every merge to main via our shared `auto` [configuration][auto_orb]\n- **Point People:** [@anandaroop][anandaroop]\n\n## Install\n\n```bash\n$ yarn add passport-local-with-otp\n```\n\n## Usage\n\n#### Configure Strategy\n\nThe local-with-otp authentication strategy authenticates users using a username\npassword, and otp.  The strategy requires a `verify` callback, which accepts\nthese credentials and calls `done` providing a user.\n\n```js\npassport.use(new LocalWithOtpStrategy(\n  function(username, password, otp, done) {\n    try {\n      const user = authenticateWithUpstreamService(username, password, otp)\n      return done(null, user)\n    } catch (error) {\n      return done(err)\n    }\n  }\n));\n```\n\n##### Available Options\n\nThis strategy takes an optional options hash before the function, e.g. `new LocalWithOtpStrategy({/* options */, callback})`.\n\nThe available options are:\n\n* `usernameField` - Optional, defaults to 'username'\n* `passwordField` - Optional, defaults to 'password'\n* `otpField` - Optional, defaults to 'otp'\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, `**Local**WithOtpStrategy` expects to find credentials in parameters\nnamed username, password and otp. If your site prefers to name these fields\ndifferently, options are available to change the defaults.\n\n    passport.use(new LocalWithOtpStrategy({\n        usernameField: 'email',\n        passwordField: 'passwd',\n        otpField: 'otp_attempt',\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 LocalWithOtpStrategy({\n        usernameField: 'email',\n        passwordField: 'passwd',\n        otpField: 'otp_attempt',\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-with-otp'` 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\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[Passport]: http://passportjs.org/\n[CircleCI]: https://app.circleci.com/pipelines/github/artsy/passport-local-with-otp\n[anandaroop]: https://github.com/anandaroop\n[npm_package]: https://www.npmjs.com/package/@artsy/passport-local-with-otp\n[auto_orb]: https://github.com/artsy/orbs/tree/main/src/auto\n","engines":{"node":">=10"},"gitHead":"046a1943965ae9bb20d4930e409083c9081e8969","scripts":{"test":"make test","prettier-write":"prettier --write {lib,test}/*.js"},"_npmUser":{"name":"artsy-engineering","email":"opensource@artsymail.com"},"licenses":[{"url":"http://www.opensource.org/licenses/MIT","type":"MIT"}],"prettier":{"semi":false,"singleQuote":false,"bracketSpacing":true},"repository":{"url":"git://github.com/artsy/passport-local-with-otp.git","type":"git"},"_npmVersion":"6.14.12","description":"Local username, password and otp authentication strategy for Passport.","directories":{},"_nodeVersion":"10.24.1","dependencies":{"passport-strategy":"1.x.x"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.0.0","mocha":"^7.0.0","prettier":"^2.0.5","make-node":"0.4.6","@artsy/auto-config":"^1.0.2","chai-passport-strategy":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/passport-local-with-otp_0.3.2-canary.12.64.0_1639169952843_0.7667977378530972","host":"s3://npm-registry-packages"}},"0.4.0-canary.13.71.0":{"name":"@artsy/passport-local-with-otp","version":"0.4.0-canary.13.71.0","keywords":["passport","local","auth","authn","authentication","username","password","otp"],"author":{"url":"https://www.artsy.net","name":"Artsy Inc."},"license":"MIT","_id":"@artsy/passport-local-with-otp@0.4.0-canary.13.71.0","maintainers":[{"name":"artsy-engineering","email":"opensource@artsymail.com"},{"name":"erikdstock","email":"erik.d.stock@gmail.com"},{"name":"xtina-starr","email":"c.thompsonms@gmail.com"},{"name":"damassi","email":"damassi.pappas@gmail.com"},{"name":"anandaroop","email":"anandaroop.roy+npm@gmail.com"},{"name":"yuki24","email":"yk.nishijima@gmail.com"},{"name":"mzikherman","email":"mzikherman@gmail.com"},{"name":"oxaudo","email":"oxaudo@yahoo.com"},{"name":"eessex","email":"eve@artsymail.com"},{"name":"arjelks","email":"ashley.jelks@artsymail.com"},{"name":"zephraph","email":"npm@just-be.dev"},{"name":"sweir27","email":"sweir27@gmail.com"},{"name":"dblandin","email":"dblandin@gmail.com"},{"name":"icirellik","email":"icirellik@gmail.com"}],"contributors":[{"url":"https://artsy.github.io","name":"Artsy Engineering"},{"name":"Jared Hanson"}],"homepage":"https://github.com/artsy/passport-local-with-otp#readme","bugs":{"url":"https://github.com/artsy/passport-local-with-otp/issues"},"dist":{"shasum":"8ec6a8a788a545af801a41cd71196838e0637662","tarball":"https://registry.npmjs.org/@artsy/passport-local-with-otp/-/passport-local-with-otp-0.4.0-canary.13.71.0.tgz","fileCount":9,"integrity":"sha512-YUtuTQbDicNQroDTO1Q9SBMVBHxJsqAOIIZHLnpFBYCpCQO92+AjX2phcAD5uTtDe2BIRGaH3hwwpREImttx5A==","signatures":[{"sig":"MEUCIHZEa31x4gI3lmpPOXGVmjxur4AUW5z5KQekD7W87sMbAiEAwDpR4/Ahp+X+YqyXEJ/aj2Snc2fh/uzZxQk7QfliySc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19181,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBDtACRA9TVsSAnZWagAAdp0P/jYxKwDq4zaDffZmNhEB\nXDiBOGO5FEbXph3iC90StWEuK032GuvsXvkVnuzCf9kT64aAOYAD5c+ZnAXJ\nJ0pmzTbnfH7UAzlBdYi/AiOkj/CvrXacJNRGblw4zcRTwB3Nlm2ctyhUBFE0\nRVrmB+mnAHFwNNAytOLiIiutUeQtPie5yoG4qsez0HhPX1Koj5fMcKgcEnuU\nvkFnuu959cg5OuJw/G6F5afbm+diHumfC5TbWlQKq2GIb/MSBlW2pRR6rXew\nWSSEBkmMU8Fc/8tZY2CRdnW0sBCTARdW5pqgh9UVMbM89vY3rV6nVkn4WFwc\noA+aYGpx3PL2c7EJJOGbwhD+9cR3KDwAXA9Xm9PYr0bLZH/E6hM6VRnrsnXv\nZFbjC9CSuWEmo3XRtzCdy+1f3zzoC1AuaLBhM9ek9f9LfyHkzKrfAcAqQT7J\n/JCiSJB9mrQO1ntUC8O7O76ZvCYBVYAfgFwZxkuZt/y0pvY5DoQZs7e6wLZw\n8K5OXKOlhgygTeFi+KQzbeKMBm63duv46A07XifUZxEnJlCoeAQMBbCakDyA\n4vUnVyTJoN1Q0yQZLO96+JkOwZGDxQEZCQkLV/x4gnqpitZD1KAm3Eb2XuaY\n/qg7cO3vbt/EYXSiLB8b0lYG7yBw3G6nH5OXkpnIu+kA2RZAQupYkR1YmCt5\nGSya\r\n=wmPv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib/index.js","readme":"# ⚠️ This repo has been deprecated and the code moved directly into [Force](https://github.com/artsy/force/blob/master/src/lib/passport-local-with-otp) \n\n## passport-local-with-otp\n\n![build status](https://circleci.com/gh/artsy/passport-local-with-otp.svg?style=shield) ![npm version](https://badge.fury.io/js/%40artsy%2Fpassport-local-with-otp.svg)\n\n[Passport] strategy for authenticating with a username,\npassword and OTP.\n\nThis module lets you authenticate using a username, password and time-based\none-time password (OTP) in your Node.js applications.\n\nThis is a fork of https://github.com/jaredhanson/passport-local, adapted for the\nuse case of submitting username, password and otp in unison to an upstream\nserver for authentication and second-factor verification in a single request.\n\n## Meta\n\n- **State:** production\n- **GitHub:** https://github.com/artsy/passport-local-with-otp\n- **CI:** [CircleCI]\n- **NPM:** New versions of [@artsy/passport-local-with-otp][npm_package] are published on every merge to main via our shared `auto` [configuration][auto_orb]\n- **Point People:** [@anandaroop][anandaroop]\n\n## Install\n\n```bash\n$ yarn add passport-local-with-otp\n```\n\n## Usage\n\n#### Configure Strategy\n\nThe local-with-otp authentication strategy authenticates users using a username\npassword, and otp.  The strategy requires a `verify` callback, which accepts\nthese credentials and calls `done` providing a user.\n\n```js\npassport.use(new LocalWithOtpStrategy(\n  function(username, password, otp, done) {\n    try {\n      const user = authenticateWithUpstreamService(username, password, otp)\n      return done(null, user)\n    } catch (error) {\n      return done(err)\n    }\n  }\n));\n```\n\n##### Available Options\n\nThis strategy takes an optional options hash before the function, e.g. `new LocalWithOtpStrategy({/* options */, callback})`.\n\nThe available options are:\n\n* `usernameField` - Optional, defaults to 'username'\n* `passwordField` - Optional, defaults to 'password'\n* `otpField` - Optional, defaults to 'otp'\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, `**Local**WithOtpStrategy` expects to find credentials in parameters\nnamed username, password and otp. If your site prefers to name these fields\ndifferently, options are available to change the defaults.\n\n    passport.use(new LocalWithOtpStrategy({\n        usernameField: 'email',\n        passwordField: 'passwd',\n        otpField: 'otp_attempt',\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 LocalWithOtpStrategy({\n        usernameField: 'email',\n        passwordField: 'passwd',\n        otpField: 'otp_attempt',\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-with-otp'` 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\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[Passport]: http://passportjs.org/\n[CircleCI]: https://app.circleci.com/pipelines/github/artsy/passport-local-with-otp\n[anandaroop]: https://github.com/anandaroop\n[npm_package]: https://www.npmjs.com/package/@artsy/passport-local-with-otp\n[auto_orb]: https://github.com/artsy/orbs/tree/main/src/auto\n","engines":{"node":">=10"},"gitHead":"55aeda5359ae34a07e9fe2bb3fdf94a313a0654f","scripts":{"test":"make test","prettier-write":"prettier --write {lib,test}/*.js"},"_npmUser":{"name":"artsy-engineering","email":"opensource@artsymail.com"},"licenses":[{"url":"http://www.opensource.org/licenses/MIT","type":"MIT"}],"prettier":{"semi":false,"singleQuote":false,"bracketSpacing":true},"repository":{"url":"git://github.com/artsy/passport-local-with-otp.git","type":"git"},"_npmVersion":"6.14.12","description":"Local username, password and otp authentication strategy for Passport.","directories":{},"_nodeVersion":"10.24.1","dependencies":{"passport-strategy":"1.x.x"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.0.0","mocha":"^7.0.0","prettier":"^2.0.5","make-node":"0.4.6","@artsy/auto-config":"^1.0.2","chai-passport-strategy":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/passport-local-with-otp_0.4.0-canary.13.71.0_1644444480353_0.9430369704122947","host":"s3://npm-registry-packages"}}},"time":{"created":"2020-05-06T04:05:25.481Z","modified":"2025-11-18T23:31:44.297Z","0.3.0":"2020-05-06T04:05:25.727Z","0.3.1":"2020-05-14T05:52:05.404Z","0.3.2-canary.12.64.0":"2021-12-10T20:59:12.996Z","0.4.0-canary.13.71.0":"2022-02-09T22:08:00.589Z"},"bugs":{"url":"https://github.com/artsy/passport-local-with-otp/issues"},"author":{"url":"https://www.artsy.net","name":"Artsy Inc."},"license":"MIT","homepage":"https://github.com/artsy/passport-local-with-otp#readme","keywords":["passport","local","auth","authn","authentication","username","password","otp"],"repository":{"url":"git://github.com/artsy/passport-local-with-otp.git","type":"git"},"description":"Local username, password and otp authentication strategy for Passport.","contributors":[{"url":"https://artsy.github.io","name":"Artsy Engineering"},{"name":"Jared Hanson"}],"maintainers":[{"email":"opensource@artsymail.com","name":"artsy-engineering"},{"email":"anandaroop.roy+npm@gmail.com","name":"anandaroop"},{"email":"mzikherman@gmail.com","name":"mzikherman"},{"email":"dblandin@gmail.com","name":"dblandin"},{"email":"joey@artsymail.com","name":"joeyaghion"}],"readme":"","readmeFilename":""}