Tutorials Forums
     Tutorials Videos
        Sign Up Now For FREE
Welcome, Guest
Username Password: Remember me

ASP.NET SOX Password Policy Enforcement
(1 viewing) (1) Guest
ASP.NET PROGRAMS, ASP.NET DESIGN, ASP.NET CODE, ASP.NET TOOLS

ASP.NET combines Active Server Pages with the .NET Framework. This technology allows you to create dynamic web applications. ASP.NET pages work in all browsers. Best of all, ASP.NET lets you build web pages using less code than you need with classic ASP. If you’re using ASP.NET to build some applications for your website, you owe it to yourself to check out the articles in this section.
  • Page:
  • 1

TOPIC: ASP.NET SOX Password Policy Enforcement

ASP.NET SOX Password Policy Enforcement 08 Dec 2009 07:31 #47

This ASP.NET script implements SOX compliant password enforcement. In this script passwords must contain minimum of 6 characters and satisfy 3 out of 4 rules below 1.Must contain Special characters 2.Must contain Upper case 3.Must contain Lower case 4.Must contain Numerics

Instructions: The first line in the .aspx file is the textbox where the password is entered. The first RegularExpressionValidator tests to make sure the password is at least 6 characters. The last RegularExpressionValidator contains the regex that validates that the password meets at least 3 of the 4 criteria:
1.Must contain Special characters
2.Must contain Upper case
3.Must contain Lower case
4.Must contain Numerics

 
<asp:TextBox ID="NewPass" runat="server" TextMode="Password" />
 
<asp:RequiredFieldValidator runat="server" ID="reqNewPass" Display="Dynamic"
ControlToValidate="NewPass"
ErrorMessage = "You must provide a New Password!" />
<asp:RegularExpressionValidator ID="regexpPass" runat="server" display="Dynamic"
ControlToValidate="NewPass"
ErrorMessage="Password must contain at least 6 nonblank characters."
ValidationExpression="[^\s]{6,255}" meta:resourcekey="regexpPassResource1" /></asp:PlaceHolder>
<asp:RegularExpressionValidator ID="regexpNewPass" runat="server" display="Dynamic"
ControlToValidate="NewPass"
ErrorMessage="Password must contain 3 of the following characters: an upper-case, lower-case, number, and a special character."
ValidationExpression="((?=.*\d)(?=.*[A-Z])(?=.*[a-z])|(?=.*\d)(?=.*[^A-Za-z0-9])(?=.*[a-z])|(?=.*[^A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z])|(?=.*\d)(?=.*[A-Z])(?=.*[^A-Za-z0-9]))^.*" />
 
 
  • mnjon
  • OFFLINE
  • CE Staff
  • Posts: 78
  • Karma: 40
CodersEngine
  • Page:
  • 1
Time to create page: 0.26 seconds