From df1c111a72cead5ecac53eb250166156551c7aa3 Mon Sep 17 00:00:00 2001 From: mposolda Date: Wed, 13 Apr 2016 12:39:55 +0200 Subject: [PATCH] KEYCLOAK-2811 FederationProvidersIntegrationTest.testReadOnly failing on MSAD --- .../ldap/mappers/msad/MSADUserAccountControlMapper.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/msad/MSADUserAccountControlMapper.java b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/msad/MSADUserAccountControlMapper.java index 033b3f40f8..229ac87dd6 100644 --- a/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/msad/MSADUserAccountControlMapper.java +++ b/federation/ldap/src/main/java/org/keycloak/federation/ldap/mappers/msad/MSADUserAccountControlMapper.java @@ -117,6 +117,10 @@ public class MSADUserAccountControlMapper extends AbstractLDAPFederationMapper { protected ModelException processFailedPasswordUpdateException(ModelException e) { + if (e.getCause() == null || e.getCause().getMessage() == null) { + return e; + } + String exceptionMessage = e.getCause().getMessage().replace('\n', ' '); Matcher m = AUTH_INVALID_NEW_PASSWORD.matcher(exceptionMessage); if (m.matches()) {