File

core/authentication/password-validation.service.ts

Description

Shared password validation service for Angular and AngularJS.

Validation logic:

  • Invalid characters → error with full message (allowed symbols)
  • Too long (>32) → error
  • Too short when NOT enforced → simple error (length only)
  • Too short when enforced → valid (checklist handles it)

Index

Properties
Methods

Methods

hasValidCharsOnly
hasValidCharsOnly(password: string)
Parameters :
Name Type Optional
password string No
Returns : boolean
validate
validate(password: string, strengthEnforced: boolean, minGreenLength?: number)

When strength is enforced, this is the green minimum from tenant settings. Defaults to DEFAULT_MIN_LENGTH.

Parameters :
Name Type Optional Description
password string No

The password to validate.

strengthEnforced boolean No

Whether password strength enforcement is enabled.

minGreenLength number Yes

Minimum length to be considered strong/green. When strength is enforced, this is the green minimum from tenant settings. Defaults to DEFAULT_MIN_LENGTH.

Properties

Readonly ALLOWED_SYMBOLS
Type : string
Default value : '`~!@#$%^&*()_|+-=?;:\'",.<>{}[]\\/'
Readonly DEFAULT_MIN_LENGTH
Type : number
Default value : 8
Readonly MAX_LENGTH
Type : number
Default value : 32
Readonly VALID_CHARS_PATTERN
Type : unknown
Default value : /^[a-zA-Z0-9`~!@#$%^&*()_|+\-=?;:'",.<>{}[\]\\/]*$/

results matching ""

    No results matching ""