Table of Contents

Class PasswordGenerator

Namespace
Dynamicweb.Security.Utilities
Assembly
Dynamicweb.Core.dll

Generates password

public class PasswordGenerator
Inheritance
PasswordGenerator
Inherited Members

Methods

CheckPasswordComplexity(string, int, ref string, ref int, bool, bool)

Checks the password complexity and returns true if the password meets complexity rules or is empty.

public static bool CheckPasswordComplexity(string password, int userId, ref string errorMessage, ref int passwordErrorCode, bool forceReuseCheck, bool isBackendCheck)

Parameters

password string

The password.

userId int

The User id.

errorMessage string

The error message.

passwordErrorCode int

The password error code.

forceReuseCheck bool

If set to true force check of password reuse.

isBackendCheck bool

If set to true force check by backend rules.

Returns

bool

True, if password complexity corresponds to system settings or is empty, otherwise False.

GeneratePassword()

public static string GeneratePassword()

Returns

string

GeneratePassword(int)

Generates a random password of the given length By default, Medium is used

public static string GeneratePassword(int passwordLength)

Parameters

passwordLength int

The length of the password to generate

Returns

string

GeneratePassword(int, SecurityLevel)

Generates a random password of the given length

public static string GeneratePassword(int passwordLength, PasswordGenerator.SecurityLevel securityLevel)

Parameters

passwordLength int

The length of the password to generate

securityLevel PasswordGenerator.SecurityLevel

The security level to enforce for the password

Returns

string
To top