{"_id":"passport-totp","_rev":"12-7df54bbf05ac3dde71fb433687d5988a","name":"passport-totp","description":"TOTP authentication strategy for Passport.","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"passport-totp","version":"0.0.1","description":"TOTP authentication strategy for Passport.","keywords":["passport","otp","oath","totp","auth","authn","authentication"],"repository":{"type":"git","url":"git://github.com/jaredhanson/passport-totp.git"},"bugs":{"url":"http://github.com/jaredhanson/passport-totp/issues"},"author":{"name":"Jared Hanson","email":"jaredhanson@gmail.com","url":"http://www.jaredhanson.net/"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"main":"./lib","dependencies":{"pkginfo":"0.2.x","passport":"~0.1.1","notp":"2.0.x"},"devDependencies":{"mocha":"1.x.x","chai":"1.x.x"},"scripts":{"test":"NODE_PATH=./lib node_modules/.bin/mocha --reporter spec --require test/bootstrap/node test/*.test.js"},"engines":{"node":">= 0.4.0"},"_id":"passport-totp@0.0.1","dist":{"shasum":"df33a6b309823f8156ff554c4bf821f87153f7da","tarball":"https://registry.npmjs.org/passport-totp/-/passport-totp-0.0.1.tgz","integrity":"sha512-aK3JpdDB/aNDQBcHGsS4Fe83FevoEnIWLbrEs7mVAPPon1vsreSAhAWUaO9MgXWVa9SefSZDS45RZaZdEbWUjQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGhS0yTtPHPh/4AQ+O3IZawrslgalR3qe+TLMvJ7X5RNAiEA2Ygbbq2AEn68/RlNqgXcw2YvoSQ4LBjNaR/db50Hsec="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"jaredhanson","email":"jaredhanson@gmail.com"},"maintainers":[{"name":"jaredhanson","email":"jaredhanson@gmail.com"}]},"0.0.2":{"name":"passport-totp","version":"0.0.2","description":"TOTP authentication strategy for Passport.","keywords":["passport","otp","oath","totp","auth","authn","authentication"],"repository":{"type":"git","url":"git://github.com/jaredhanson/passport-totp.git"},"bugs":{"url":"http://github.com/jaredhanson/passport-totp/issues"},"author":{"name":"Jared Hanson","email":"jaredhanson@gmail.com","url":"http://www.jaredhanson.net/"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"main":"./lib","dependencies":{"notp":"2.0.x","passport-strategy":"1.0.0","pkginfo":"0.2.x"},"devDependencies":{"mocha":"1.x.x","chai":"1.x.x"},"scripts":{"test":"NODE_PATH=./lib node_modules/.bin/mocha --reporter spec --require test/bootstrap/node test/*.test.js"},"engines":{"node":">= 0.4.0"},"gitHead":"fb124585fbe5f6a1a4e88351cd2f10e4b9ffa286","homepage":"https://github.com/jaredhanson/passport-totp","_id":"passport-totp@0.0.2","_shasum":"3173815af6b75186f969fd4256be7ffd4c1be59a","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"jaredhanson","email":"jaredhanson@gmail.com"},"maintainers":[{"name":"jaredhanson","email":"jaredhanson@gmail.com"}],"dist":{"shasum":"3173815af6b75186f969fd4256be7ffd4c1be59a","tarball":"https://registry.npmjs.org/passport-totp/-/passport-totp-0.0.2.tgz","integrity":"sha512-WhCnOSvLy4HDEZxwRwFGRpzQzqw+Q/vDZGzralzjTZerZeNI8EFwxmlgiIohhsBCkLZ+u3BR8Bz2v+gXQoDTcw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGkhhfl/Qa2WNgKNNuZECvFPC5MQQXvY1EpQrPLTxUn7AiAfI1+RgyGkaoi2eXQ6cjn6A5VQrT/GKuB0+smtiQdxDg=="}]}}},"readme":"# Passport-TOTP\n\n[Passport](http://passportjs.org/) strategy for two-factor authentication using\na [TOTP](http://tools.ietf.org/html/rfc6238) value.\n\nThis module lets you authenticate using a TOTP value in your Node.js\napplications.  By plugging into Passport, TOTP two-factor authentication can be\neasily and unobtrusively integrated into any application or framework that\nsupports [Connect](http://www.senchalabs.org/connect/)-style middleware,\nincluding [Express](http://expressjs.com/).  TOTP values can be generated by\nhardware devices or software applications, including [Google Authenticator](https://code.google.com/p/google-authenticator/).\n\nNote that in contrast to most Passport strategies, TOTP authentication requires\nthat a user already be authenticated using an initial factor.  Requirements\nregarding when to require a second factor are a matter of application-level\npolicy, and outside the scope of both Passport and this strategy.\n\n## Install\n\n    $ npm install passport-totp\n\n## Usage\n\n#### Configure Strategy\n\nThe TOTP authentication strategy authenticates a user using a TOTP value\ngenerated by a hardware device or software application (known as a token).  The\nstrategy requires a `setup` callback.\n\nThe `setup` callback accepts a previously authenticated `user` and calls `done`\nproviding a `key` and `period` used to verify the HOTP value.  Authentication\nfails if the value is not verified.\n\n    passport.use(new TotpStrategy(\n      function(user, done) {\n        TotpKey.findOne({ userId: user.id }, function (err, key) {\n          if (err) { return done(err); }\n          return done(null, key.key, key.period);\n        });\n      }\n    ));\n\n#### Authenticate Requests\n\nUse `passport.authenticate()`, specifying the `'totp'` strategy, to authenticate\nrequests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/)\napplication:\n\n    app.post('/verify-otp', \n      passport.authenticate('totp', { failureRedirect: '/verify-otp' }),\n      function(req, res) {\n        req.session.authFactors = [ 'totp' ];\n        res.redirect('/');\n      });\n\n## Examples\n\nFor a complete, working example, refer to the [two-factor example](https://github.com/jaredhanson/passport-totp/tree/master/examples/two-factor).\n\n## Tests\n\n    $ npm install\n    $ make test\n\n[![Build Status](https://secure.travis-ci.org/jaredhanson/passport-totp.png)](http://travis-ci.org/jaredhanson/passport-totp)\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) 2013 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>\n","maintainers":[{"name":"jaredhanson","email":"jaredhanson@gmail.com"}],"time":{"modified":"2022-06-23T13:38:10.541Z","created":"2013-05-12T04:29:43.770Z","0.0.1":"2013-05-12T04:29:47.442Z","0.0.2":"2015-08-27T15:51:55.626Z"},"author":{"name":"Jared Hanson","email":"jaredhanson@gmail.com","url":"http://www.jaredhanson.net/"},"repository":{"type":"git","url":"git://github.com/jaredhanson/passport-totp.git"},"users":{"tcauduro":true,"nayrangnu":true,"dyaa":true,"joshperry":true,"temasm":true,"marcobiedermann":true},"homepage":"https://github.com/jaredhanson/passport-totp","keywords":["passport","otp","oath","totp","auth","authn","authentication"],"bugs":{"url":"http://github.com/jaredhanson/passport-totp/issues"},"readmeFilename":"README.md"}