Skip to content

feat: add support for flexible password policy#323

Merged
ankita10119 merged 2 commits intomasterfrom
SDK-7517
Jan 23, 2026
Merged

feat: add support for flexible password policy#323
ankita10119 merged 2 commits intomasterfrom
SDK-7517

Conversation

@ankita10119
Copy link
Contributor

Description

Adds support for flexible password complexity policies with granular validation rules. This enhancement allows configuring password requirements based on character types, sequential/identical character restrictions, and length constraints.

Changes

New Interfaces & Types

  • Added PasswordComplexityPolicy interface with configurable validation rules:
    • Character type requirements (uppercase, lowercase, numbers, special characters)
    • Minimum length validation
    • Identical character detection and blocking
    • Sequential character detection and blocking
    • Character type rule modes ("all" or "at_least")
  • Extended DBConnection interface to include password_options.complexity configuration

Validation Logic

  • Implemented validateWithComplexityPolicy() function with support for:
    • Minimum length enforcement
    • Repeated character detection (e.g., "aaa")
    • Sequential character detection (e.g., "abc", "123")
    • Character type validation with detailed per-rule feedback
  • Added helper functions hasSequentialChars() and hasIdenticalChars() for pattern detection

Integration

  • Updated signup and signup-password screens to:
    • Expose passwordComplexityPolicy in transaction members
    • Automatically use complexity policy validation when available
    • Fall back to legacy password policy validation for backward compatibility
  • Added getPasswordComplexityPolicy() helper to extract policy from transaction context

Backward Compatibility

Maintains full backward compatibility by falling back to existing password policy validation when complexity policy is not configured.

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not the default branch

@ankita10119 ankita10119 requested a review from a team as a code owner January 15, 2026 19:51
@ankita10119 ankita10119 merged commit c8da783 into master Jan 23, 2026
3 checks passed
@ankita10119 ankita10119 deleted the SDK-7517 branch January 23, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants