Copied to clipboard

Flag this post as spam?

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


  • Streety 358 posts 568 karma points
    Mar 30, 2020 @ 09:47
    Streety
    0

    Password history of Umbraco Users NOT members

    I am trying to work out how to configure the change password process for Umbraco users. I have a requirement for any new passwords for back end user accounts must be unique and can't be recycled.

    How to I "break into" this change password process. I can see how you do it with the login process by inheriting from "umbraco.providers.members.UmbracoMembershipProvider". How to you do this with Change Password?

    Also I'll need to salt and hash the prospective password with the same salt as the umbraco process. I have found a method for this:

    HashPasswordForStorage in membership provider base. How do I use this? Does MembershipProvider inherit this class?

    Any help gratefully received?

  • Streety 358 posts 568 karma points
    Apr 01, 2020 @ 12:56
    Streety
    0

    Head scratching moment:

    So I've created a class that inherits from

    public class CustomUsersMembershipProvider : UsersMembershipProvider
    

    Then overridden the

    protected override bool PerformChangePassword(string username, string oldPassword, string newPassword)
    

    and updated the web.config to find the new provider...

            <add name="UsersMembershipProvider"     
             type="Whizbang.Membership.CustomUsersMembershipProvider, Whizbang"
    

    and set a breakpoint...and nothing. VS doesn't hit it.

    Am I missing something to override the change password function.

  • Streety 358 posts 568 karma points
    Apr 02, 2020 @ 11:52
    Streety
    0

    Bump

  • Perry Cope 31 posts 195 karma points
    Apr 03, 2020 @ 10:18
    Perry Cope
    0

    I answerd in https://our.umbraco.com/forum/extending-umbraco-and-using-the-api/92429-password-history#comment-318353 how i did it for members honestly cant remember if users is different did you set your default provider in the web.config to the one you made?

    Also i think maybe ChangePassword which is public is what your looking to override not PerformChangePassword

  • Streety 358 posts 568 karma points
    Apr 03, 2020 @ 10:31
    Streety
    0

    It seems all the old Membership provider stuff floating around Stack and this forum is out of date.

    Umbraco > 7.something is using the .net Identity membership system so any custom providers are ignored.

    Would have saved myself a bunch of time.

    Thanks Perry

  • Perry Cope 31 posts 195 karma points
    Apr 03, 2020 @ 11:08
    Perry Cope
    1

    For users? i kind of remember something about them on 2 different systems. the method i mention and you tried definitely works for Members in all versions of 7.x i used.

    But i cant help with users sorry, if you figure it out let us know! :)

Please Sign in or register to post replies

Write your reply to:

Draft