SkillAgentSearch skills...

NetEscapades.AspNetCore.Identity.Validators

A collection of ASP.NET Core Identity IPasswordValidators

Install / Use

/learn @andrewlock/NetEscapades.AspNetCore.Identity.Validators
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

NetEscapades.AspNetCore.Identity.Validators

Build status

<!--[![Travis](https://img.shields.io/travis/andrewlock/NetEscapades.AspNetCore.Identity.Validators.svg?maxAge=3600&label=travis)](https://travis-ci.org/andrewlock/NetEscapades.AspNetCore.Identity.Validators)-->

NuGet MyGet CI

A collection of ASP.NET Core Identity IPasswordValidators for use with Microsoft.AspNetCore.Identity.EntityFrameworkCore.

Usage

Includes the following validators:

  • EmailAsPasswordValidator - Verify the user has not used their email as their password

  • UsernameAsPasswordValidator - Verify the user has not used their email as their password

  • InvalidPhraseValidator - Ensure the user hasn't used specific phrases, such as the url or domain of your website

You can add the validators to your project using the AddPasswordValidator<TValidator> method exposed by IdentityBuilder. Alternatively, use the extension methods on IdentityBuilder included in the package:

services.AddIdentity<ApplicationUser, IdentityRole>()
    .AddEntityFrameworkStores<ApplicationDbContext>()
    .AddDefaultTokenProviders()
    .AddEmailAsPasswordValidator<ApplicationUser>() // Add the email as password validator
    .AddUsernameAsPasswordValidator<ApplicationUser>() // Add the username as password validator
    .AddInvalidPhraseValidator<ApplicationUser>(new []{"MyDomainName.com"}); // Add the invalid phrase validator

NOTE This package currently support ASP.NET Core Identity 2.0 (.NET Standard 2.0) and .NET Core 3.0

Installing

Install using the NetEscapades.AspNetCore.Identity.Validators NuGet package:

PM> Install-Package NetEscapades.AspNetCore.Identity.Validators

or

dotnet add package NetEscapades.AspNetCore.Identity.Validators

Additional Resources

Related Skills

View on GitHub
GitHub Stars19
CategoryDevelopment
Updated2y ago
Forks3

Languages

C#

Security Score

75/100

Audited on Aug 24, 2023

No findings