{"id":15051366,"url":"https://github.com/nextcloud/password_policy","last_synced_at":"2026-03-02T22:39:19.615Z","repository":{"id":40333393,"uuid":"61870843","full_name":"nextcloud/password_policy","owner":"nextcloud","description":":lock: Let the admin define certain rules for passwords, e.g. a minimum length","archived":false,"fork":false,"pushed_at":"2026-02-23T01:32:36.000Z","size":60187,"stargazers_count":37,"open_issues_count":38,"forks_count":26,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-02-23T07:47:08.864Z","etag":null,"topics":["admin-tools","nextcloud"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nextcloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-06-24T08:47:31.000Z","updated_at":"2026-02-23T01:32:34.000Z","dependencies_parsed_at":"2026-01-20T04:00:29.928Z","dependency_job_id":null,"html_url":"https://github.com/nextcloud/password_policy","commit_stats":null,"previous_names":[],"tags_count":864,"template":false,"template_full_name":null,"purl":"pkg:github/nextcloud/password_policy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud%2Fpassword_policy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud%2Fpassword_policy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud%2Fpassword_policy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud%2Fpassword_policy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nextcloud","download_url":"https://codeload.github.com/nextcloud/password_policy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud%2Fpassword_policy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30022939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T22:30:10.381Z","status":"ssl_error","status_checked_at":"2026-03-02T22:23:34.650Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["admin-tools","nextcloud"],"created_at":"2024-09-24T21:33:52.166Z","updated_at":"2026-03-02T22:39:19.590Z","avatar_url":"https://github.com/nextcloud.png","language":"PHP","readme":"\u003c!--\n  - SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: CC0-1.0\n--\u003e\n# Password policy\n\n[![REUSE status](https://api.reuse.software/badge/github.com/nextcloud/password_policy)](https://api.reuse.software/info/github.com/nextcloud/password_policy) [![PHPUnit status](https://github.com/nextcloud/password_policy/actions/workflows/phpunit-sqlite.yml/badge.svg)](https://github.com/nextcloud/password_policy/actions/workflows/phpunit-sqlite.yml)\n\nThis app enables the the admin to define certain rules for passwords, for example the minimum length of a password.\n\nBy default the app enforces a minimum password length of 8 characters and checks every password against the 1.000.000 most common passwords.\n\nCurrently the app checks passwords for public link shares and for user passwords if the database backend is used.\n\nOnce the app is enabled you find the \"Password policy\" settings in the admin section:\n\n![screenshot of the admin section](./screenshots/password_policy_settings.png)\n\n## Integrate in other apps\n\n### Generate passwords\nThis app is capable of generating passwords according to the configured policy, so to create a password for your app:\n\n````php\n$eventDispatcher = \\OCP\\Server::get(IEventDispatcher::class);\n$event = new \\OCP\\Security\\Events\\GenerateSecurePasswordEvent();\ntry {\n  $eventDispatcher-\u003edispatchTyped($event);\n} catch (\\OCP\\HintException $e) {\n  // ⚠️ The password generation failed, more information is set on the exception\n}\n$password = $event-\u003egetPassword() ?? 'fallback when this app is not enabled';\n````\n\n### Validate passwords\nYou can easily check passwords for your own app by adding following code to your app:\n\n````php\n$eventDispatcher = \\OCP\\Server::get(IEventDispatcher::class);\n$password = 'the-password-you-want-to-validate';\n$event = new \\OCP\\Security\\Events\\ValidatePasswordPolicyEvent($password);\ntry {\n  $eventDispatcher-\u003edispatchTyped($event);\n  // ✅ The password is valid;\n} catch (\\OCP\\HintException $e) {\n  // ❌ The password is invalid\n}\n````\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextcloud%2Fpassword_policy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextcloud%2Fpassword_policy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextcloud%2Fpassword_policy/lists"}