{"id":28076780,"url":"https://github.com/jaredhanson/passport-totp","last_synced_at":"2025-10-12T07:20:01.892Z","repository":{"id":8422149,"uuid":"10009153","full_name":"jaredhanson/passport-totp","owner":"jaredhanson","description":"TOTP authentication strategy for Passport and Node.js.","archived":false,"fork":false,"pushed_at":"2019-11-16T23:49:16.000Z","size":13,"stargazers_count":150,"open_issues_count":13,"forks_count":45,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-10-03T17:51:45.313Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaredhanson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-12T04:22:42.000Z","updated_at":"2025-06-12T14:48:29.000Z","dependencies_parsed_at":"2022-08-07T04:16:33.442Z","dependency_job_id":null,"html_url":"https://github.com/jaredhanson/passport-totp","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jaredhanson/passport-totp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredhanson%2Fpassport-totp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredhanson%2Fpassport-totp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredhanson%2Fpassport-totp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredhanson%2Fpassport-totp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaredhanson","download_url":"https://codeload.github.com/jaredhanson/passport-totp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredhanson%2Fpassport-totp/sbom","scorecard":{"id":506342,"data":{"date":"2025-08-11","repo":{"name":"github.com/jaredhanson/passport-totp","commit":"9abb4862d60862028ab5af112a331c81d220d77b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":1,"reason":"Found 1/10 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T23:18:48.192Z","repository_id":8422149,"created_at":"2025-08-19T23:18:48.192Z","updated_at":"2025-08-19T23:18:48.192Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010647,"owners_count":26084784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-13T01:51:13.084Z","updated_at":"2025-10-12T07:20:01.843Z","avatar_url":"https://github.com/jaredhanson.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"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 \u003c[http://jaredhanson.net/](http://jaredhanson.net/)\u003e\n\n\u003ca target='_blank' rel='nofollow' href='https://app.codesponsor.io/link/vK9dyjRnnWsMzzJTQ57fRJpH/jaredhanson/passport-totp'\u003e  \u003cimg alt='Sponsor' width='888' height='68' src='https://app.codesponsor.io/embed/vK9dyjRnnWsMzzJTQ57fRJpH/jaredhanson/passport-totp.svg' /\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredhanson%2Fpassport-totp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaredhanson%2Fpassport-totp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredhanson%2Fpassport-totp/lists"}