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
passwordstringThe password.
userIdintThe User id.
errorMessagestringThe error message.
passwordErrorCodeintThe password error code.
forceReuseCheckboolIf set to
trueforce check of password reuse.isBackendCheckboolIf set to
trueforce check by backend rules.
Returns
- bool
True, if password complexity corresponds to system settings or is empty, otherwiseFalse.
GeneratePassword()
public static string GeneratePassword()
Returns
GeneratePassword(int)
Generates a random password of the given length By default, Medium is used
public static string GeneratePassword(int passwordLength)
Parameters
passwordLengthintThe length of the password to generate
Returns
GeneratePassword(int, SecurityLevel)
Generates a random password of the given length
public static string GeneratePassword(int passwordLength, PasswordGenerator.SecurityLevel securityLevel)
Parameters
passwordLengthintThe length of the password to generate
securityLevelPasswordGenerator.SecurityLevelThe security level to enforce for the password