Stanford-password-policy-dotnet is a password validator library for ASP.NET Core.
The Stanford password policy is a dynamic password policy that encourages the use of easy to remember, yet secure passphrases instead of hard to remember passwords.
Using the dotnet-cli
dotnet add package StanfordPasswordPolicy
or with the nuget package manager console:
Install-Package StanfordPasswordPolicy
services.AddIdentity<AppUser, IdentityRole>(opt =>
{
// If you don't want Identity's defaults to interfere with your new policy
opt.Password = StanfordPasswordValidatorBase.NoDefaultPasswordOptions;
})
.AddPasswordValidator<StanfordPasswordValidator<AppUser>>();
You can also check out SampleApp for a more complete example.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.