Copied to clipboard

Flag this post as spam?

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


  • Gordon Brown 2 posts 22 karma points
    May 13, 2011 @ 13:43
    Gordon Brown
    0

    Problems with using Membership and maxInvalidPasswordAttempts

     

    On V4.7 I'm using bespoke .NET controls which are using the standard microsoft Login and ChangePassword controls along with the standard functionality provided by the Membership object to validate and control passwords etc.

    Outwith umbraco I've done this for a normal C# ASP.NET example web site. I set up a whole load of parameters in the Web.config like:

    maxInvalidPasswordAttempts="5" 
    minRequiredPasswordLength="2"
    inRequiredNonalphanumericCharacters="1"

    and everything worked brilliantly without any bespoke code. Took me about 2 hours including installing SQL Server. A no brainer!

    However in the Umbraco system, it's not working so well.

    The the validation functionality seems to work. Programatically I can create Members and set Member groups and Member types using a mixture of Member and umbracoMember objects. However the parameters highlighted above seem to be completely ignored. And I can't lock people out either by using multiple ValidateUser() with a rubbish password. (Which seems like an inelegant sol!)

    The cmsMember table only seems to have the following 4 fields: Id, LoginName, Password, LastUpdated. My normal C# ASP.NET example web site has many more fields in the corresponding table. Like IsLockedOut and FailedPasswordAttemptCount.

    The out of the box microsoft functionality is not working. Any ideas how I can get it working?

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    May 13, 2011 @ 13:53
    Michael Latouche
    0

    Hi Gordon,

    To use the other "standard" Membership provider properties within UmbracoMembershipProvider, you just have to add some extra properties to your MemberType and linking them to the umbraco membership provider settings in the web.config file.

    See this wiki post for more information: our.umbraco.org/.../umbracomembershipprovider-properties :

    <add name="UmbracoMembershipProvider" 
     
    type="umbraco.providers.members.UmbracoMembershipProvider"
     
    enablePasswordRetrieval="true"
     
    enablePasswordReset="false"
     
    requiresQuestionAndAnswer="true"
     
    defaultMemberTypeAlias="Some Type"
     
    passwordFormat="Hashed"
     
    umbracoApprovePropertyTypeAlias="approved"
     
    umbracoLockPropertyTypeAlias="lock"
     
    umbracoFailedPasswordAttemptsPropertyTypeAlias="failed_logins"
     
    umbracoCommentPropertyTypeAlias="comments"
     
    umbracoLastLoginPropertyTypeAlias="last_login"
     
    umbracoPasswordRetrievalQuestionPropertyTypeAlias="question"
     
    umbracoPasswordRetrievalAnswerPropertyTypeAlias="answer" />

    You will just need to add the properties you need, and it should then work like a charm.

    Hope this helps

    Cheers,

    Michael.

  • Gordon Brown 2 posts 22 karma points
    May 19, 2011 @ 11:02
    Gordon Brown
    0

    Michael,

    Thanks for this. :) This information has filled in about 70% of the missing functionality. Any idea about the remaining 30%?

    Specifically:
    minRequiredPasswordLength="8"
    minRequiredNonalphanumericCharacters="2"

    This would be trivial stuff to code manually, but I'd prefer to do it in the 'standard' way if possible. 

Please Sign in or register to post replies

Write your reply to:

Draft