aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

Add minimum length attributes to Identity classes

Open rgordey opened this issue 3 years ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

I am trying to set a minimum Length for all strings, if not specified, in ef core's ConfigureConventions, so it won't default to max. Of course my DbContext inherits from IdentityDbContext<IdentityUser>. So PasswordHash got affected... and broke.

protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
{
            configurationBuilder.Properties<String>()
                .HaveMaxLength(25);
}

Describe the solution you'd like

Please set PasswordHash (and other length sensitive fields) default max length in the model.

Additional context

No response

rgordey avatar Jan 05 '23 14:01 rgordey