Copied to clipboard

Flag this post as spam?

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


  • Jeroen 3 posts 73 karma points
    Jan 31, 2018 @ 19:36
    Jeroen
    0

    MemberService.CreateWithIdentity not working with hashed passwords

    Within the web.config the password format is configured as Hashed

    <add name="UmbracoMembershipProvider" type="Umbraco.Web.Security.Providers.MembersMembershipProvider, Umbraco" minRequiredNonalphanumericCharacters="1" minRequiredPasswordLength="10" useLegacyEncoding="false" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Member" passwordFormat="Hashed" allowManuallyChangingPassword="false" />
    

    When I configure a new member in the Umbraco CMS backend the password is stored encrypted in the database.

    I'm using the MemberService to create new Members in Umbraco.

    var memberService = Umbraco.Core.ApplicationContext.Current.Services.MemberService;
    var member = memberService.CreateWithIdentity(email, email, password, "Member");
    

    If I do this the password is stored as pain text in the database. If I try to login with the newly created user it will not work since it tries to decrypt the password.

    Membership.ValidateUser(email, model.password)
    

    Why doesn't the function "CreateWithIdentity" take the setting "PasswordFormat" into account?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies