{"id":13721115,"url":"https://github.com/kuzzleio/kuzzle-plugin-auth-passport-local","last_synced_at":"2025-09-09T01:33:37.352Z","repository":{"id":44779142,"uuid":"48056170","full_name":"kuzzleio/kuzzle-plugin-auth-passport-local","owner":"kuzzleio","description":"Provide local authentication with username/password for Kuzzle","archived":false,"fork":false,"pushed_at":"2025-05-07T12:14:09.000Z","size":906,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-08-09T09:40:44.792Z","etag":null,"topics":["kuzzle","kuzzle-authentication","kuzzle-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kuzzleio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-12-15T16:41:56.000Z","updated_at":"2025-05-07T12:13:52.000Z","dependencies_parsed_at":"2024-01-14T22:05:12.910Z","dependency_job_id":"e4ec37b2-7a24-4bba-891d-16300836f293","html_url":"https://github.com/kuzzleio/kuzzle-plugin-auth-passport-local","commit_stats":{"total_commits":170,"total_committers":25,"mean_commits":6.8,"dds":0.7941176470588236,"last_synced_commit":"a66815a959aac95008bd483554885095dd38511a"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/kuzzleio/kuzzle-plugin-auth-passport-local","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuzzleio%2Fkuzzle-plugin-auth-passport-local","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuzzleio%2Fkuzzle-plugin-auth-passport-local/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuzzleio%2Fkuzzle-plugin-auth-passport-local/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuzzleio%2Fkuzzle-plugin-auth-passport-local/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kuzzleio","download_url":"https://codeload.github.com/kuzzleio/kuzzle-plugin-auth-passport-local/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuzzleio%2Fkuzzle-plugin-auth-passport-local/sbom","scorecard":{"id":574410,"data":{"date":"2025-08-11","repo":{"name":"github.com/kuzzleio/kuzzle-plugin-auth-passport-local","commit":"c9bd35f6b4f0971d01bcc081a1db3fbc188012ce"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"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":"Code-Review","score":3,"reason":"Found 6/18 approved changesets -- score normalized to 3","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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/pull_request.workflows.yml:1","Warn: no topLevel permission defined: .github/workflows/push_branches.yaml:1","Info: no jobLevel write permissions found"],"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":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull_request.workflows.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-auth-passport-local/pull_request.workflows.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull_request.workflows.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-auth-passport-local/pull_request.workflows.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_branches.yaml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-auth-passport-local/push_branches.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push_branches.yaml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/kuzzleio/kuzzle-plugin-auth-passport-local/push_branches.yaml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   2 npmCommand dependencies pinned"],"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":"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.md:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/push_branches.yaml:10"],"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":"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":"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":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'","Warn: branch protection not enabled for branch '5-stable'"],"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 21 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":"16 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-x4c5-c7rf-jjgv","Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-v923-w3x8-wh69","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-c76h-2ccp-4975","Warn: Project is vulnerable to: GHSA-cxrh-j4jr-qwg3"],"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-20T17:15:54.425Z","repository_id":44779142,"created_at":"2025-08-20T17:15:54.425Z","updated_at":"2025-08-20T17:15:54.425Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274232029,"owners_count":25245856,"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-09-08T02:00:09.813Z","response_time":121,"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":["kuzzle","kuzzle-authentication","kuzzle-plugin"],"created_at":"2024-08-03T01:01:12.615Z","updated_at":"2025-09-09T01:33:37.325Z","avatar_url":"https://github.com/kuzzleio.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Authentication plugins"],"readme":"[![Build Status](https://travis-ci.org/kuzzleio/kuzzle-plugin-auth-passport-local.svg?branch=master)](https://travis-ci.org/kuzzleio/kuzzle-plugin-auth-passport-local)\n\n# Plugin Local Password Authentication\n\nThis plugin provides a local authentication with username/password with [passportjs module](http://passportjs.org/docs/username-password).\n\nBy default, this plugin is already installed in Kuzzle.\n\n## Compatibility matrice\n\n| Kuzzle Version | Plugin Version |\n| -------------- | -------------- |\n| 1.x.x          | 5.x.x          | \n| 2.x.x          | 6.x.x          | \n\n# Configuration\n\nThe default configuration is as follow:\n\n```json\n{\n  \"algorithm\": \"sha512\",\n  \"stretching\": true,\n  \"digest\": \"hex\",\n  \"encryption\": \"hmac\",\n  \"requirePassword\": false,\n  \"passwordPolicies\": []\n}\n```\n\n## General settings\n\n* `algorithm`: one of the supported encryption algorithms (run [crypto.getHashes()](https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_gethashes) to get the complete list). Examples: `sha256`, `sha512`, `blake2b512`, `whirlpool`, ...\n* `stretching` must be a boolean and controls if the password is stretched or not.\n* `digest` describes how the hashed password is stored in the persisting layer. See other possible values in the [node.js documentation](https://nodejs.org/api/buffer.html#buffer_buf_tostring_encoding_start_end)\n* `encryption` determines whether the hashing algorithm uses `crypto.createHash` (`hash`) or `crypto.createHmac` (`hmac`). For more details, see the [node.js documentation](https://nodejs.org/api/crypto.html)\n* `requirePassword` must be a boolean. If true, this makes this plugin refuse any credentials update or deletion, unless the currently valid password is provided or the change is performed via the `security` controller\n* `resetPasswordExpiresIn`: A positive time representation of the delay after which a reset password token expires (see [ms](https://www.npmjs.com/package/ms) for possible formats). Users with expired passwords are given a `resetPasswordToken` when logging in and must change their password to be allowed to log in again.\n\n## Password policies\n\n_Since 6.2.0_ \n\nPassword policies can be used to define a set of additional rules to apply to users, or to groups of users.\n\nEach password policy is an object with the following properties:\n\n* `appliesTo`: (mandatory). Can be either set to the `*` to match all users, or an object.\n* `appliesTo.users`: An array of user `kuids` the policy applies to.\n* `appliesTo.profiles`: An array of `profile` ids the policy applies to.\n* `appliesTod.roles`: An array of `role` ids the policy applies to.\n\n\u003e At least one of `users`, `profiles` or `roles` properties must be set if `appliesTo` is an object.\n\n### Optional properties\n\n* `expiresAfter`: A positive time representation of the delay after which a password expires (see [ms](https://www.npmjs.com/package/ms) for possible formats). Users with expired passwords are given a `resetPasswordToken` when logging in and must change their password to be allowed to log in again.\n* `forbidLoginInPassword`: If set to `true`, prevent users to use their username in part of the password. The check is case-**in**sensitive.\n* `forbidReusedPasswordCount`: The number of passwords to store in history and check against when a new password is set.\n* `mustChangePasswordIfSetByAdmin`: If set to `true`, when the password is set for a user by someone else, the user will receive a `resetPasswordToken` upon next login and will have to change her password before being allowed to log in again.\n* `passwordRegex`: A string representation of a regular expression to test on new passwords.\n\n### Examples\n\n```json\n{\n  \"passwordPolicies\": [\n    {\n      \"appliesTo\": \"*\",\n      \"forbidLoginPassword\": true,\n      \"passwordRegex\": \".{6,}\"\n    },\n    {\n      \"appliesTo\": {\n        \"profiles\": [\"editor\"],\n        \"roles\": [\"admin\"]\n      },\n      \"expiresAfter\": \"30d\",\n      \"mustChangePasswordIfSetByAdmin\": true,\n      \"passwordRegex\": \"^(?=.*[a-zA-Z])(?=.*[0-9])(?=.{8,})\"\n    },\n    {\n      \"appliesTo\": {\n        \"roles\": [\"admin\"]\n      },\n      \"passwordRegex\": \"^(((?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*\\\\W)(?=.{8,}))|(?=.{24,}))\"\n    }\n  ]\n}\n```\n\nIn the example above, no user can use a password that includes the login and the password must be at least 6 chars long.\n\nEditors and admin users passwords expire every 30 days and the password must be at least 8 chars long and include at least one letter and one digit.\n\nAdmin users passwords must either be 24 or more chars long, or include a lower case char, an upper case char, a digit and a special char.\n\n\n# Usage\n\n## Login\n\nTo log in using Kuzzle's API:\n\n```json\n{\n  \"controller\": \"auth\",\n  \"action\": \"login\",\n  \"strategy\": \"local\",\n  \"body\": {\n    \"username\": \"\u003cusername\u003e\",\n    \"password\": \"\u003cpassword\u003e\"\n  }\n}\n```\n\n## requirePassword option\n\nBy default, there is no restriction to update or delete credentials (provided the current user is logged in).\n\nHowever, if the option `requirePassword` is set to true, this plugin will refuse to update credentials unless either the currently valid password is also provided, or the change is performed via the `security` controller.\n\nTo provide the password parameter, add a `currentPassword` argument in the request body of the request.\n\nExample (non-HTTP protocol):\n\n```js\n{\n  \"controller\": \"auth\",\n  \"action\": \"updateMyCredentials\",\n  \"strategy\": \"local\",\n  \"jwt\": \"\u003ccurrently valid token\u003e\",\n  \"body\": {\n    \"currentPassword\": \"\u003ccurrently valid password\u003e\",\n    // just skip the fields you don't want to update\n    \"username\": \"\u003cnew username\u003e\",\n    \"password\": \"\u003cnew password\u003e\"\n  }\n}\n```\n\n## Reset Password\n\n### Permissions\n\nBy default, all routes are denied to non-admin users. You will need to allow them if needed. A typical setup may look like:\n\n_.kuzzlerc_\n```json\n{\n  \"security\": {\n    \"roles\": {\n      \"anonymous\": {\n        \"controllers\": {\n          \"auth\": {\n            \"actions\": {\n              \"checkToken\": true,\n              \"getCurrentUser\": true,\n              \"getMyRights\": true,\n              \"login\": true\n            }\n          },\n          \"kuzzle-plugin-auth-passport-local/password\": {\n            \"actions\": {\n              \"reset\": true\n            }\n          },\n          \"server\": {\n            \"actions\": {\n              \"publicApi\": true\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nSee [Kuzzle user authentication documentation](https://docs.kuzzle.io/core/2/guides/main-concepts/authentication/) for more details about Kuzzle authentication mechanism.\n\n### Reset password\n\n```json\n{\n  \"controller\": \"kuzzle-plugin-auth-passport-local/password\",\n  \"action\": \"reset\",\n  \"body\": {\n    \"password\": \"new password\",\n    \"token\": \"\u003creset password\u003e\"\n  }\n}\n```\n\nFor HTTP:\n\n```shell\ncurl \\\n    -XPOST \\\n    -H \"Content-type: application/json\" \\\n    -d '{\"password\": \"new password\", \"token\": \"\u003creset token\u003e\"}' \\\n    kuzzle/_plugin/kuzzle-plugin-auth-passport-local/password/reset\n```\n\nResponse:\n\n```json\n{\n  \"requestId\": \"8a3c1366-e9cc-4e4e-8fe8-8e90f79d02a5\",\n  \"status\": 200,\n  \"error\": null,\n  \"controller\": \"kuzzle-plugin-auth-passport-local/password\",\n  \"action\": \"reset\",\n  \"collection\": null,\n  \"index\": null,\n  \"volatile\": null,\n  \"result\": {\n    \"_id\": \"user\",\n    \"expiresAt\": 1587466666298,\n    \"jwt\": \"\u003clogin token\u003e\",\n    \"ttl\": 3600000\n  }\n}\n```\n\nThe returned jwt can be used the same way as if the user had logged in.\n\n### Get a reset password token\n\nA reset token is automatically returned upon login if the password is either expired or must be changed according to the defined policies.\n\nAnother way to get a reset token for a user is to use the `getResetPasswordToken` route. \nFor instance, it can be used programmatically from a plugin to generate a reset password link for a user in case he lost his password.\n\n\u003e :warning: **This route MUST be secured and accessible to permitted users only!**\n\n```json\n{\n  \"controller\": \"kuzzle-plugin-auth-passport-local/password\",\n  \"action\": \"getResetPasswordToken\",\n  \"_id\": \"\u003ckuid\u003e\"\n}\n```\n\nFor HTTP\n\n```\ncurl kuzzle/_plugin/kuzzle-plugin-auth-passport-local/password/resetToken/\u003ckuid\u003e\n```\n\nResponse:\n```json\n{\n  \"requestId\": \"7a701827-98eb-4122-8691-8f27d9c77fef\",\n  \"status\": 200,\n  \"error\": null,\n  \"controller\": \"kuzzle-plugin-auth-passport-local/password\",\n  \"action\": \"getResetPasswordToken\",\n  \"collection\": null,\n  \"index\": null,\n  \"volatile\": null,\n  \"result\": {\n    \"resetToken\": \"\u003creset password token\u003e\"\n  }\n}\n```\n\n# How to create a plugin\n\nSee [Kuzzle plugin documentation](https://docs.kuzzle.io/core/2/plugins/) about plugin for more information about how to create your own plugin.\n\n# About Kuzzle\n\nFor UI and IoT developers, [Kuzzle](https://github.com/kuzzleio/kuzzle) is an open-source solution that handles all the data management\n(CRUD, real-time storage, search, high-level features, etc).\n\n[Kuzzle](https://github.com/kuzzleio/kuzzle) features are accessible through a secured API. It can be used through a large choice of protocols such as HTTP, Websocket or MQTT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuzzleio%2Fkuzzle-plugin-auth-passport-local","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkuzzleio%2Fkuzzle-plugin-auth-passport-local","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuzzleio%2Fkuzzle-plugin-auth-passport-local/lists"}