Change the password length requirement in Umbraco
This solution will work with Umbraco 8.xx versions. Previous or newer versions may need some additional or fewer changes.
In Umbraco default password length is 10, and need to provide a valid email address for the user name.
If you are developing or designing a website using Umbraco and testing it you may need to shorten the password length or use a short username in your development website to save time. (NOT in the production site)
Changing default password length in a new installation
This method is for a fresh Umbraco installation. For an existing installation, there is some extra work to do. I will discuss it later.
Lots of people have an issue with changing the configuration to suit this requirement.
First, we will look at the issue. Open the Web.config file and go to the following section
<!-- Membership Provider -->
<membership defaultProvider="UmbracoMembershipProvider" userIsOnlineTimeWindow="15"> <providers> <clear /> <add name="UmbracoMembershipProvider" type="Umbraco.Web.Security.Providers.MembersMembershipProvider, Umbraco" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="10" useLegacyEncoding="false" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Member" passwordFormat="Hashed" allowManuallyChangingPassword="false" /> <add name="UsersMembershipProvider" type="Umbraco.Web.Security.Providers.UsersMembershipProvider, Umbraco" /> </providers> </membership>
There are 2 membership providers in the Web.config file;
- "UmbracoMembershipProvider"
- "UsersMembershipProvider"
In the "UsersMembershipProvider" node there is no minRequiredPasswordLength attribute, therefore it always takes the ASP.NET identity framework default value of 10.
To change that value all you have to do is add minRequiredPasswordLength="3" (whatever length you want to change) to the "UsersMembershipProvider" node (DO NOT need to change the value in "UmbracoMembershipProvider" )
We only need to change the "UsersMembershipProvider" element NOT the values in the "UmbracoMembershipProvider" element.
Accepting a username instead of forcing a valid email address
This workaround only worked after creating the admin user with an email address and then login into
the admin dashboard. Change the "web.config" as shown above.
Increasing user online time window
Also, there is another useful thing when you are testing or developing an Umbraco website is to increase the userIsOnlineTimeWindow="15" (parent node) to possibly 1500.
Comments
Post a Comment