This library provides an IPasswordValidator for Microsoft ASP.NET Core Identity which validates passwords against HaveIBeenPwned.com's Pwned Passwords using the v2 RESTful API.
To use the default error message:
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddIdentity<MyApplicationUser, IdentityRole>()
.AddPwnedPasswordsValidator<MyApplicationUser>();
}
}
To specify a custom error message for pwned password:
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddIdentity<MyApplicationUser, IdentityRole>()
.AddPwnedPasswordsValidator<MyApplicationUser>(options => options.ErrorMessage = "Custom error message");
}
}
Install-Package BlackstarSolar.AspNetCore.Identity.PwnedPasswords
This project is licensed under the MIT License - see the LICENSE.md file for details