Copied to clipboard

Flag this post as spam?

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


  • Delete me 45 posts 66 karma points
    Oct 11, 2009 @ 22:20
    Delete me
    0

    Change AutoGeneratePassword format

    I'm using the CreateUserWizard the AutoGeneratePassword option, to create Members and email them an autogenerated password. But the generated passwords are not very user-friendly, like "#/u¤]?|§£"
    Is there at way to make the passwords more simple, like (a-z)(A-Z)(0-9)?

    My code:

    <script runat="server">
    protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
    {
    Roles.AddUserToRole(CreateUserWizard1.UserName, "Group");
    }
    </script>
    <asp:CreateUserWizard ID="CreateUserWizard1" runat="server"
    OnCreatedUser="CreateUserWizard1_CreatedUser" 
    AutoGeneratePassword="True" >
    
    <MailDefinition>
    <..........>
    </MailDefinition>
    </asp:CreateUserWizard>
    

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Oct 11, 2009 @ 23:36
    Aaron Powell
    0

    You need to configure the PasswordStrengthRegularExpression in the web.config - http://msdn.microsoft.com/en-us/library/system.web.security.membership.passwordstrengthregularexpression.aspx

  • Delete me 45 posts 66 karma points
    Oct 11, 2009 @ 23:50
    Delete me
    0

    Are you sure?

    http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.createuserwizard.autogeneratepassword.aspx
    "You cannot create users using the CreateUserWizard if AutoGeneratePassword is set to true and the PasswordStrengthRegularExpression property is set in the application's Web.config. An error message indicating an invalid password will result."

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Oct 11, 2009 @ 23:57
    Aaron Powell
    0

    Oh whoops, i miss-read that, I thought it said 'You can create...'

    My bad!

    I think that the password auto-generation is done by the user control though not Umbraco. I'll have a look

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Oct 12, 2009 @ 00:16
    Aaron Powell
    1

    Yeah looks like it's generated in the .NET framework, I'm not sure if it's possible to change, unless you hook into the events of the control and generate your own on-the-fly.

  • Delete me 45 posts 66 karma points
    Oct 12, 2009 @ 13:17
    Delete me
    0

    Thanks for your work and time!

    Generating my own pass on-the-fly is not a problem, but how do hook into the event?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Oct 12, 2009 @ 15:37
    Dirk De Grave
    0

    Hook up with the SendingMail event of the CreateUserWizard exactly as you did with the CreatedUser event. Here's some info on the event and how to use: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.createuserwizard.sendingmail.aspx

     

    Cheers,

    /Dirk

  • 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