Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Søren Kottal 712 posts 4570 karma points MVP 6x c-trib
    Sep 07, 2022 @ 12:02
    Søren Kottal
    0

    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?

  • Lucas Bisgaard 19 posts 128 karma points c-trib
    Sep 08, 2022 @ 07:12
    Lucas Bisgaard
    0

    Hey Søren,

    Try to look into IUserValidator.ValidateAsync

  • Søren Kottal 712 posts 4570 karma points MVP 6x c-trib
    Sep 08, 2022 @ 09:14
  • Søren Kottal 712 posts 4570 karma points MVP 6x c-trib
    Sep 12, 2022 @ 07:55
    Søren Kottal
    102

    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 overrode PasswordSignInAsync to do my extra checks.

    I then added the sign in manager in my composer with builder.Services.AddScoped<IMemberSignInManager, CustomMemberSignInManager>();

Please Sign in or register to post replies

Write your reply to:

Draft