PasswordValidator Class

Summary

Provides the default password policy for Identity.

Syntax

public class PasswordValidator : IPasswordValidator

GitHub

View on GitHub

class Microsoft.AspNet.Identity.PasswordValidator

Constructors

PasswordValidator(Microsoft.AspNet.Identity.IdentityErrorDescriber)

Constructions a new instance of Microsoft.AspNet.Identity.PasswordValidator.

Arguments:
  • errors (Microsoft.AspNet.Identity.IdentityErrorDescriber) – The Microsoft.AspNet.Identity.IdentityErrorDescriber to retrieve error text from.
public PasswordValidator(IdentityErrorDescriber errors = null)

Properties

Describer()

Gets the Microsoft.AspNet.Identity.IdentityErrorDescriber used to supply error text.

Return type:Microsoft.AspNet.Identity.IdentityErrorDescriber
public IdentityErrorDescriber Describer { get; }

Methods

IsDigit(System.Char)

Returns a flag indicting whether the supplied character is a digit.

Arguments:
  • c (System.Char) – The character to check if it is a digit.
Return type:

System.Boolean

Returns:

True if the character is a digit, otherwise false.

public virtual bool IsDigit(char c)
IsLetterOrDigit(System.Char)

Returns a flag indicting whether the supplied character is an ASCII letter or digit.

Arguments:
  • c (System.Char) – The character to check if it is an ASCII letter or digit.
Return type:

System.Boolean

Returns:

True if the character is an ASCII letter or digit, otherwise false.

public virtual bool IsLetterOrDigit(char c)
IsLower(System.Char)

Returns a flag indicting whether the supplied character is a lower case ASCII letter.

Arguments:
  • c (System.Char) – The character to check if it is a lower case ASCII letter.
Return type:

System.Boolean

Returns:

True if the character is a lower case ASCII letter, otherwise false.

public virtual bool IsLower(char c)
IsUpper(System.Char)

Returns a flag indicting whether the supplied character is an upper case ASCII letter.

Arguments:
  • c (System.Char) – The character to check if it is an upper case ASCII letter.
Return type:

System.Boolean

Returns:

True if the character is an upper case ASCII letter, otherwise false.

public virtual bool IsUpper(char c)
ValidateAsync<TUser>(Microsoft.AspNet.Identity.UserManager<TUser>, TUser, System.String)

Validates a password as an asynchronous operation.

Arguments:
  • manager (Microsoft.AspNet.Identity.UserManager{{TUser}}) – The Microsoft.AspNet.Identity.UserManager`1 to retrieve the user properties from.
  • user ({TUser}) – The user whose password should be validated.
  • password (System.String) – The password supplied for validation
Return type:

System.Threading.Tasks.Task{Microsoft.AspNet.Identity.IdentityResult}

Returns:

The task object representing the asynchronous operation.

public virtual Task<IdentityResult> ValidateAsync<TUser>(UserManager<TUser> manager, TUser user, string password)where TUser : class