Strong password check to consider underscore as a special character
[controller.git] / opendaylight / usermanager / api / src / main / java / org / opendaylight / controller / usermanager / UserConfig.java
index 07c814adf14c7b2d35f9991a9bd3e5875296f922..2e03db16558ad61ad90b428fb9fd76116682a074 100644 (file)
@@ -38,7 +38,7 @@ public class UserConfig implements Serializable {
     private static final boolean strongPasswordCheck = Boolean.getBoolean("enableStrongPasswordCheck");
     private static final String BAD_PASSWORD = "Bad Password";
     private static final int USERNAME_MAXLENGTH = 32;
-    protected static final String PASSWORD_REGEX = "(?=.*[^\\w])(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,256}$";
+    protected static final String PASSWORD_REGEX = "(?=.*[^a-zA-Z0-9])(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,256}$";
     private static final Pattern INVALID_USERNAME_CHARACTERS = Pattern.compile("([/\\s\\.\\?#%;\\\\]+)");
     private static MessageDigest oneWayFunction = null;
     static {