ValidateUser from MembershipProvider in the new ASP.NET Identity setup
I'm in the process of "upgrading" an old project, that uses a custom MembershipProvider to add some additional checks, when a member logs in. For this, the ValidateUser method of the MembershipProvider is overridden with some code.
How can I do this, in the new setup where ASP.NET Identity is used?
ValidateUser from MembershipProvider in the new ASP.NET Identity setup
I'm in the process of "upgrading" an old project, that uses a custom MembershipProvider to add some additional checks, when a member logs in. For this, the ValidateUser method of the MembershipProvider is overridden with some code.
How can I do this, in the new setup where ASP.NET Identity is used?
Hey Søren,
Try to look into IUserValidator.ValidateAsync
Thanks - that might be what I need. Found some more info here: https://robertwray.co.uk/blog/using-iuservalidator-to-provide-additional-user-validation-rules-in-asp-net-core-identity
Following up on this, I needed to be able to handle "not yet created" members too.
So I ended up creating my own SignInManager, inheriting from
MemberSignInManager
. In this I overrodePasswordSignInAsync
to do my extra checks.I then added the sign in manager in my composer with
builder.Services.AddScoped<IMemberSignInManager, CustomMemberSignInManager>();
is working on a reply...