Copied to clipboard

Flag this post as spam?

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


  • Mounhim Tahtahi 41 posts 62 karma points
    Jul 21, 2014 @ 15:00
    Mounhim Tahtahi
    0

    6.2.1. Create member

    What am I doing wrong here:

            <add name="UmbracoMembershipProvider" 

                 type="Umbraco.Web.Security.Providers.MembersMembershipProvider, Umbraco" 

                 minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="4" 

                 useLegacyEncoding="true" enablePasswordRetrieval="false" 

                 enablePasswordReset="true" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Customer" 

                 passwordFormat="Hashed" 

                 umbracoApprovePropertyTypeAlias="approved" umbracoLockPropertyTypeAlias="lockedOut" 

                 umbracoCommentPropertyTypeAlias="comments" umbracoLastLoginPropertyTypeAlias="lastLogonDate" 

                 umbracoPasswordRetrievalQuestionPropertyTypeAlias="passwordRetrievalQuestion" 

                 umbracoPasswordRetrievalAnswerPropertyTypeAlias="passwordRetrievalAnswer" />

    And in the code:
                        var member = ApplicationContext.Current.Services.MemberService.CreateMemberWithIdentity(email, email, email, "Customer");
                        ApplicationContext.Current.Services.MemberService.Save(member);
                        member = ApplicationContext.Current.Services.MemberService.GetById(member.Id);
                        member.PasswordQuestion = secretQuestion;
                        member.RawPasswordAnswerValue = secretAnswer;
                        member.IsApproved = false;
                        ApplicationContext.Current.Services.MemberService.AssignRole(member.Id, "Customers");
                        ApplicationContext.Current.Services.MemberService.Save(member);
    
    Now the user gets created with the correct group. But the Password question and password answer are not stored. How come?
Please Sign in or register to post replies

Write your reply to:

Draft