No description
  • PHP 90.6%
  • JavaScript 8.9%
  • Vue 0.4%
Find a file
github-actions[bot] a47daebae2
Merge pull request #984 from nextcloud/dependabot/npm_and_yarn/nextcloud/stylelint-config-3.2.2
Chore(deps-dev): Bump @nextcloud/stylelint-config from 3.1.1 to 3.2.2
2026-07-11 02:40:56 +00:00
.github
.tx
appinfo
css chore: Recompile assets 2026-07-09 14:27:18 +02:00
img
js chore: Recompile assets 2026-07-09 14:27:18 +02:00
l10n
lib
LICENSES
lists
screenshots
src feat: Migrate to vue3 2026-07-09 14:26:15 +02:00
templates
tests
vendor-bin
.gitattributes
.gitignore
.l10nignore
.php-cs-fixer.dist.php
.scrutinizer.yml
AUTHORS.md
codecov.yml
composer.json
composer.lock
eslint.config.js feat: Migrate to vue3 2026-07-09 14:26:15 +02:00
LICENSE
openapi.json
package-lock.json Merge pull request #984 from nextcloud/dependabot/npm_and_yarn/nextcloud/stylelint-config-3.2.2 2026-07-11 02:40:56 +00:00
package.json Merge pull request #984 from nextcloud/dependabot/npm_and_yarn/nextcloud/stylelint-config-3.2.2 2026-07-11 02:40:56 +00:00
psalm.xml
README.md
REUSE.toml
stylelint.config.cjs
tsconfig.json
vite.config.ts

Password policy

REUSE status PHPUnit status

This app enables the the admin to define certain rules for passwords, for example the minimum length of a password.

By default the app enforces a minimum password length of 8 characters and checks every password against the 1.000.000 most common passwords.

Currently the app checks passwords for public link shares and for user passwords if the database backend is used.

Once the app is enabled you find the "Password policy" settings in the admin section:

screenshot of the admin section

Integrate in other apps

Generate passwords

This app is capable of generating passwords according to the configured policy, so to create a password for your app:

$eventDispatcher = \OCP\Server::get(IEventDispatcher::class);
$event = new \OCP\Security\Events\GenerateSecurePasswordEvent();
try {
  $eventDispatcher->dispatchTyped($event);
} catch (\OCP\HintException $e) {
  // ⚠️ The password generation failed, more information is set on the exception
}
$password = $event->getPassword() ?? 'fallback when this app is not enabled';

Validate passwords

You can easily check passwords for your own app by adding following code to your app:

$eventDispatcher = \OCP\Server::get(IEventDispatcher::class);
$password = 'the-password-you-want-to-validate';
$event = new \OCP\Security\Events\ValidatePasswordPolicyEvent($password);
try {
  $eventDispatcher->dispatchTyped($event);
  // ✅ The password is valid;
} catch (\OCP\HintException $e) {
  // ❌ The password is invalid
}