{"id":15673473,"url":"https://github.com/jwebcoder/dynamic-passport-strategies","last_synced_at":"2025-10-13T02:49:07.537Z","repository":{"id":35045245,"uuid":"199180804","full_name":"JWebCoder/dynamic-passport-strategies","owner":"JWebCoder","description":"dynamically add and remove passport strategies in your express application during runtime","archived":false,"fork":false,"pushed_at":"2023-01-23T23:50:13.000Z","size":1650,"stargazers_count":1,"open_issues_count":20,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-05T22:17:41.181Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/JWebCoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"JWebCoder","patreon":"jwebcoder","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-07-27T15:16:43.000Z","updated_at":"2023-10-18T21:53:09.000Z","dependencies_parsed_at":"2023-02-13T05:00:30.675Z","dependency_job_id":null,"html_url":"https://github.com/JWebCoder/dynamic-passport-strategies","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/JWebCoder/dynamic-passport-strategies","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWebCoder%2Fdynamic-passport-strategies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWebCoder%2Fdynamic-passport-strategies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWebCoder%2Fdynamic-passport-strategies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWebCoder%2Fdynamic-passport-strategies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JWebCoder","download_url":"https://codeload.github.com/JWebCoder/dynamic-passport-strategies/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWebCoder%2Fdynamic-passport-strategies/sbom","scorecard":{"id":69369,"data":{"date":"2025-08-11","repo":{"name":"github.com/JWebCoder/dynamic-passport-strategies","commit":"a64c6aa31d1cbe9cff8720f8d297bc3d3f608ac8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/4 approved changesets -- score normalized to 0","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":"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":"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":"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":"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":"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":"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":"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":"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 26 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"}},{"name":"Vulnerabilities","score":0,"reason":"56 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-8hfj-j24r-96c4","Warn: Project is vulnerable to: GHSA-wc69-rhjr-hc9g","Warn: Project is vulnerable to: GHSA-56x4-j7p9-fcf9","Warn: Project is vulnerable to: GHSA-v78c-4p63-2j6c","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-v923-w3x8-wh69","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-h452-7996-h45h","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-15T03:28:08.047Z","repository_id":35045245,"created_at":"2025-08-15T03:28:08.047Z","updated_at":"2025-08-15T03:28:08.047Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014019,"owners_count":26085347,"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-13T02:00:06.723Z","response_time":61,"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":"2024-10-03T15:40:45.003Z","updated_at":"2025-10-13T02:49:07.490Z","avatar_url":"https://github.com/JWebCoder.png","language":"TypeScript","funding_links":["https://github.com/sponsors/JWebCoder","https://patreon.com/jwebcoder"],"categories":[],"sub_categories":[],"readme":"# Dynamic Passport Strategies\n\nDynamically add and remove passport strategies in your express application during runtime\n\nSupports NodeJS cluster by spreading the configuration across the multiple NodeJS instances\n\n**Check the example folder for a fully working application**\n\n## Installation\n\n`npm i dynamic-passport-strategies`\n\n## Usage\n\n```js\nimport express from 'express'\nimport session from 'express-session'\nimport path from 'path'\nimport authentication from 'dynamic-passport-strategies'\n\n// set the folder containing your strategies, authentication for example\nauthentication.configure({\n  modulesPath: path.join(__dirname, './authentication')\n  strategies: ['facebook'],\n})\n\nconst app = express()\napp.use([\n  session({\n    secret: 'stuff thats cool',\n    saveUninitialized: true,\n    resave: true,\n  }),\n  authentication.initialize(),\n  authentication.session(),\n])\n\n// setup the strategies to use and add them to the application middleware\napp.use('/', authentication.router)\n\napp.listen(9000, function() {\n  debug('Process ' + process.pid + ' is listening on port 9000')\n})\n```\n\n## Using Cluster Module\n\n**On the worker node**\n```js\n...\n// just activate it\nauthentication.configure({\n  cluster: true,\n  modulesPath: path.join(__dirname, './authentication'),\n  strategies: ['facebook'],\n})\n\nconst app = express()\napp.use([\n...\n```\n\n**And on the master node**\n\n```js\nimport cluster from 'cluster'\nimport { authenticationCluster } from 'dynamic-passport-strategies'\n\nif (cluster.isMaster) {\n  // initialize the authentication control\n  authenticationCluster()\n  loadMaster()\n} else {\n  loadWorker()\n}\n\n```\n\n## Adding a strategy\n\nCreate a new file called [strategy].[js,ts] inside the folder `./authentication` like we set above\n\nAll strategies inside the folder `./authentication` used on this example can be activated or deactivated\n\n```js\nimport { Router } from 'express'\nimport { PassportStatic } from 'passport'\nimport passportFacebook from 'passport-facebook'\n\nconst Strategy = passportFacebook.Strategy\n\nclass FacebookAuth {\n  private passport: PassportStatic\n\n  // constructor is required and it should add the strategy into passport middleware\n  constructor(passport: PassportStatic) {\n    this.passport = passport\n    this.passport.use(\n      new Strategy(/* check passport-facebook module for a complete description https://github.com/jaredhanson/passport-facebook */)\n    )\n  }\n\n  // routes must return an express.Router with the desired endpoints for authentication\n  public routes() {\n    const router = Router()\n\n    router.get('/login/facebook',\n      this.passport.authenticate('facebook', { scope: ['email'], failureRedirect: '/login' })\n    )\n\n    router.get('/login/facebook/return',\n      this.passport.authenticate('facebook', { scope: ['email'], failureRedirect: '/login' }),\n      function(req, res) {\n        res.render('facebook/loggedIn.html', {username: req.user.name})\n      }\n    )\n\n    return router\n  }\n}\n\nexport default FacebookAuth\n```\n\n## De/Activating Strategies On Request\n\nAuthenticate with the administration role into the application with one of the currently active authentication systems, and use\n\n`/load/:strategy` - activates a currently deactivated strategy\n`/unload/:strategy` - deactivates a currently active strategy\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwebcoder%2Fdynamic-passport-strategies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwebcoder%2Fdynamic-passport-strategies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwebcoder%2Fdynamic-passport-strategies/lists"}