Skip to content

Latest commit

 

History

History
49 lines (31 loc) · 1.75 KB

README.md

File metadata and controls

49 lines (31 loc) · 1.75 KB

Stanford-password-policy-dotnet Codacy Badge Build status

Stanford-password-policy-dotnet is a password validator library for ASP.NET Core.

What is it

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.

Installation

Using the dotnet-cli

dotnet add package StanfordPasswordPolicy

or with the nuget package manager console:

Install-Package StanfordPasswordPolicy

Usage

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.

Contributing

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.

License

Apache License 2.0

Obligatory XKCD

XKCD#936