Revision 49556
Added by Sofia Baltzi over 6 years ago
LDAPActions.java | ||
---|---|---|
160 | 160 |
// if(!mods.isEmpty()) { |
161 | 161 |
// ldapConnector.getConnection().modify(entry.getDN(), mods); |
162 | 162 |
// } |
163 |
// if(!password.matches("(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{6,}")){ |
|
164 |
// throw new CustomLDAPException("Invalid password!"); |
|
165 |
// } |
|
163 | 166 |
// PasswordModifyExtendedRequest passwordModifyExtendedRequest = new PasswordModifyExtendedRequest(entry.getDN(), (String) null, password); |
164 | 167 |
// PasswordModifyExtendedResult passwordModifyResult = (PasswordModifyExtendedResult) ldapConnector.getConnection().processExtendedOperation(passwordModifyExtendedRequest); |
165 | 168 |
// } else { |
... | ... | |
180 | 183 |
dn = "uid=" + entry.getAttributeValue("uid") + "," + ldapConnector.getUsersDN(); |
181 | 184 |
//logger.info("dn " + dn); |
182 | 185 |
} |
186 |
|
|
187 |
if(!password.matches("(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{6,}")){ |
|
188 |
throw new CustomLDAPException("Invalid password!"); |
|
189 |
} |
|
190 |
|
|
183 | 191 |
//Modification mod1 = new Modification(ModificationType.REPLACE, "userPassword", password); |
184 | 192 |
PasswordModifyExtendedRequest passwordModifyExtendedRequest = new PasswordModifyExtendedRequest(dn, (String) null, password); |
185 | 193 |
PasswordModifyExtendedResult passwordModifyResult = (PasswordModifyExtendedResult) ldapConnector.getConnection().processExtendedOperation(passwordModifyExtendedRequest); |
Also available in: Unified diff
Add error check for ldap password