diff --git a/modules/platform/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPFilterMatcher.java b/modules/platform/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPFilterMatcher.java
index 56d2a5322e2..72216c83f6f 100644
--- a/modules/platform/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPFilterMatcher.java
+++ b/modules/platform/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPFilterMatcher.java
@@ -20,7 +20,6 @@
 
 package org.nuxeo.ecm.directory.ldap;
 
-import java.io.IOException;
 import java.text.ParseException;
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
@@ -30,15 +29,17 @@ import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 
-import org.apache.directory.shared.ldap.filter.BranchNode;
-import org.apache.directory.shared.ldap.filter.ExprNode;
-import org.apache.directory.shared.ldap.filter.FilterParser;
-import org.apache.directory.shared.ldap.filter.FilterParserImpl;
-import org.apache.directory.shared.ldap.filter.PresenceNode;
-import org.apache.directory.shared.ldap.filter.SimpleNode;
-import org.apache.directory.shared.ldap.filter.SubstringNode;
-import org.apache.directory.shared.ldap.name.DefaultStringNormalizer;
-import org.apache.directory.shared.ldap.schema.Normalizer;
+import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.ldap.model.filter.AndNode;
+import org.apache.directory.shared.ldap.model.filter.BranchNode;
+import org.apache.directory.shared.ldap.model.filter.ExprNode;
+import org.apache.directory.shared.ldap.model.filter.FilterParser;
+import org.apache.directory.shared.ldap.model.filter.NotNode;
+import org.apache.directory.shared.ldap.model.filter.OrNode;
+import org.apache.directory.shared.ldap.model.filter.PresenceNode;
+import org.apache.directory.shared.ldap.model.filter.SimpleNode;
+import org.apache.directory.shared.ldap.model.filter.SubstringNode;
+import org.apache.directory.shared.ldap.model.schema.normalizers.DefaultStringNormalizer;
 import org.nuxeo.ecm.directory.DirectoryException;
 
 /**
@@ -51,13 +52,7 @@ import org.nuxeo.ecm.directory.DirectoryException;
  */
 public class LDAPFilterMatcher {
 
-    private final FilterParser parser;
-
-    // lazily initialized normalizer for the substring match
-    private Normalizer normalizer;
-
     LDAPFilterMatcher() {
-        parser = new FilterParserImpl();
     }
 
     /**
@@ -72,9 +67,9 @@ public class LDAPFilterMatcher {
             return true;
         }
         try {
-            ExprNode parsedFilter = parser.parse(filter);
+            ExprNode parsedFilter = FilterParser.parse(filter);
             return recursiveMatch(attributes, parsedFilter);
-        } catch (DirectoryException | IOException | ParseException e) {
+        } catch (DirectoryException | ParseException e) {
             throw new DirectoryException("could not parse LDAP filter: " + filter, e);
         }
     }
@@ -105,7 +100,7 @@ public class LDAPFilterMatcher {
      *
      * @return true if the equality holds
      */
-    protected static boolean simpleMatch(Attributes attributes, SimpleNode simpleElement) {
+    protected static boolean simpleMatch(Attributes attributes, SimpleNode<String> simpleElement) {
         Attribute attribute = attributes.get(simpleElement.getAttribute());
         if (attribute == null) {
             // null attribute cannot match any equality statement
@@ -117,12 +112,12 @@ public class LDAPFilterMatcher {
             try {
                 while (rawValues.hasMore()) {
                     String rawValue = rawValues.next().toString();
-                    if (isCaseSensitive || !(simpleElement.getValue() instanceof String)) {
+                    if (isCaseSensitive || !(simpleElement.getValue().getString() instanceof String)) {
                         if (simpleElement.getValue().equals(rawValue)) {
                             return true;
                         }
                     } else {
-                        String stringElementValue = (String) simpleElement.getValue();
+                        String stringElementValue = simpleElement.getValue().getString();
                         if (stringElementValue.equalsIgnoreCase(rawValue)) {
                             return true;
                         }
@@ -171,22 +166,21 @@ public class LDAPFilterMatcher {
             try {
                 while (rawValues.hasMore()) {
                     String rawValue = rawValues.next().toString();
-                    getNormalizer();
                     StringBuilder sb = new StringBuilder();
                     String initial = substringElement.getInitial();
                     String finalSegment = substringElement.getFinal();
                     if (initial != null && !initial.isEmpty()) {
-                        sb.append(Pattern.quote((String) normalizer.normalize(initial)));
+                        sb.append(Pattern.quote(DefaultStringNormalizer.normalizeString(initial)));
                     }
                     sb.append(".*");
                     for (Object segment : substringElement.getAny()) {
                         if (segment instanceof String) {
-                            sb.append(Pattern.quote((String) normalizer.normalize(segment)));
+                            sb.append(Pattern.quote(DefaultStringNormalizer.normalizeString((String)segment)));
                             sb.append(".*");
                         }
                     }
                     if (finalSegment != null && !finalSegment.isEmpty()) {
-                        sb.append(Pattern.quote((String) normalizer.normalize(finalSegment)));
+                        sb.append(Pattern.quote(DefaultStringNormalizer.normalizeString(finalSegment)));
                     }
                     Pattern pattern;
                     try {
@@ -207,40 +201,33 @@ public class LDAPFilterMatcher {
                 rawValues.close();
             }
             return false;
-        } catch (NamingException e1) {
+        } catch (NamingException | LdapException e1) {
             throw new DirectoryException("could not retrieve value for attribute: " + substringElement.getAttribute());
         }
     }
 
-    private Normalizer getNormalizer() {
-        if (normalizer == null) {
-            normalizer = new DefaultStringNormalizer();
-        }
-        return normalizer;
-    }
-
     /**
      * Handle conjunction, disjunction and negation nodes and recursively call the generic matcher on children.
      *
      * @return the boolean value of the evaluation of the sub expression
      */
     private boolean branchMatch(Attributes attributes, BranchNode branchElement) {
-        if (branchElement.isConjunction()) {
+        if (branchElement instanceof AndNode) {
             for (ExprNode child : branchElement.getChildren()) {
                 if (!recursiveMatch(attributes, child)) {
                     return false;
                 }
             }
             return true;
-        } else if (branchElement.isDisjunction()) {
+        } else if (branchElement instanceof OrNode) {
             for (ExprNode child : branchElement.getChildren()) {
                 if (recursiveMatch(attributes, child)) {
                     return true;
                 }
             }
             return false;
-        } else if (branchElement.isNegation()) {
-            return !recursiveMatch(attributes, branchElement.getChild());
+        } else if (branchElement instanceof NotNode) {
+            return !recursiveMatch(attributes, branchElement.getFirstChild());
         } else {
             throw new DirectoryException("unsupported branching filter element type: " + branchElement.toString());
         }
diff --git a/modules/platform/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPReference.java b/modules/platform/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPReference.java
index 36e35aab1ee..8c7c8093555 100644
--- a/modules/platform/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPReference.java
+++ b/modules/platform/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPReference.java
@@ -45,8 +45,9 @@ import javax.naming.ldap.Rdn;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.directory.shared.ldap.codec.util.LdapURL;
-import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.model.filter.LdapURL;
+import org.apache.directory.shared.ldap.model.filter.SearchScope;
+import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
 import org.nuxeo.common.xmap.annotation.XNode;
 import org.nuxeo.common.xmap.annotation.XNodeList;
 import org.nuxeo.common.xmap.annotation.XObject;
@@ -579,14 +580,14 @@ public class LDAPReference extends AbstractReference implements Cloneable {
                         try {
                             while (ldapUrls.hasMore()) {
                                 LdapURL ldapUrl = new LdapURL(ldapUrls.next().toString());
-                                String candidateDN = pseudoNormalizeDn(ldapUrl.getDn().getUpName());
+                                String candidateDN = pseudoNormalizeDn(ldapUrl.getDn().getName());
                                 // check base URL
                                 if (!targetDn.endsWith(candidateDN)) {
                                     continue;
                                 }
 
                                 // check onelevel scope constraints
-                                if (ldapUrl.getScope() == SearchControls.ONELEVEL_SCOPE) {
+                                if (ldapUrl.getScope().getScope() == SearchControls.ONELEVEL_SCOPE) {
                                     int targetDnSize = new LdapName(targetDn).size();
                                     int urlDnSize = new LdapName(candidateDN).size();
                                     if (targetDnSize - urlDnSize > 1) {
@@ -778,11 +779,11 @@ public class LDAPReference extends AbstractReference implements Cloneable {
                 try {
                     while (rawldapUrls.hasMore()) {
                         LdapURL ldapUrl = new LdapURL(rawldapUrls.next().toString());
-                        String linkDn = pseudoNormalizeDn(ldapUrl.getDn().getUpName());
+                        String linkDn = pseudoNormalizeDn(ldapUrl.getDn().getName());
                         String directoryDn = pseudoNormalizeDn(targetDirconfig.getSearchBaseDn());
                         int scope = SearchControls.ONELEVEL_SCOPE;
-                        int scopePart = ldapUrl.getScope();
-                        if (scopePart == SearchControls.SUBTREE_SCOPE) {
+                        SearchScope scopePart = ldapUrl.getScope();
+                        if (scopePart.getScope() == SearchControls.SUBTREE_SCOPE) {
                             scope = SearchControls.SUBTREE_SCOPE;
                         }
                         if (!linkDn.endsWith(directoryDn) && !directoryDn.endsWith(linkDn)) {
diff --git a/modules/platform/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPServerDescriptor.java b/modules/platform/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPServerDescriptor.java
index b07f6bb1ae0..67746b6a51b 100644
--- a/modules/platform/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPServerDescriptor.java
+++ b/modules/platform/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPServerDescriptor.java
@@ -23,6 +23,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Objects;
@@ -34,9 +35,11 @@ import javax.naming.NamingException;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.directory.shared.ldap.codec.util.LdapURL;
-import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
-import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.model.filter.LdapURL;
+import org.apache.directory.shared.ldap.model.name.Dn;
+import org.apache.directory.shared.ldap.model.name.Rdn;
+import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
 import org.nuxeo.common.xmap.annotation.XNode;
 import org.nuxeo.common.xmap.annotation.XNodeList;
 import org.nuxeo.common.xmap.annotation.XObject;
@@ -191,7 +194,7 @@ public class LDAPServerDescriptor {
                 /*
                  * RFC-2782 - Check to see if an LDAP SRV record is defined in the DNS server
                  */
-                String domain = convertDNtoFQDN(ldapUrl.getDn().getUpName());
+                String domain = convertDNtoFQDN(ldapUrl.getDn());
                 if (domain != null) {
                     /*
                      * Dynamic URL - retrieve from SRV record
@@ -276,24 +279,20 @@ public class LDAPServerDescriptor {
      * @param dn base DN of the domain
      * @return the FQDN or null is DN is not matching the expected structure
      */
-    protected String convertDNtoFQDN(String dn) {
-        try {
-            LdapDN ldapDN = new LdapDN(dn);
-            Enumeration<String> components = ldapDN.getAll();
+    protected String convertDNtoFQDN(Dn ldapDN) {
+            Iterator<Rdn> components = ldapDN.iterator();
             List<String> domainComponents = new ArrayList<>();
-            while (components.hasMoreElements()) {
-                String component = components.nextElement();
-                if (component.startsWith("dc=")) {
-                    domainComponents.add(component.substring(3));
+            while (components.hasNext()) {
+                Rdn component = components.next();
+                if (component.getName().startsWith("dc=")) {
+                    domainComponents.add(component.getName().substring(3));
                 } else {
                     break;
                 }
             }
             Collections.reverse(domainComponents);
+            log.error(domainComponents);
             return StringUtils.join(domainComponents, ".");
-        } catch (InvalidNameException e) {
-            throw new DirectoryException(e);
-        }
     }
 
     public boolean isPoolingEnabled() {
diff --git a/modules/platform/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/test/java/org/nuxeo/ecm/directory/ldap/TestFilterMatcher.java b/modules/platform/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/test/java/org/nuxeo/ecm/directory/ldap/TestFilterMatcher.java
index 1a37f909d77..f64c70ffd12 100644
--- a/modules/platform/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/test/java/org/nuxeo/ecm/directory/ldap/TestFilterMatcher.java
+++ b/modules/platform/nuxeo-platform-directory/nuxeo-platform-directory-ldap/src/test/java/org/nuxeo/ecm/directory/ldap/TestFilterMatcher.java
@@ -24,7 +24,7 @@ package org.nuxeo.ecm.directory.ldap;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-import org.apache.directory.shared.ldap.message.AttributesImpl;
+import javax.naming.directory.BasicAttributes;
 import org.junit.Test;
 
 /**
@@ -41,7 +41,7 @@ public class TestFilterMatcher {
 
     @Test
     public void testAtomicFilter() throws Exception {
-        AttributesImpl attributes = new AttributesImpl();
+        BasicAttributes attributes = new BasicAttributes();
         attributes.put("attribute1", "value1");
         attributes.put("attribute2", "val$ue2");
         attributes.put("attribute3", "val^ue3");
@@ -85,7 +85,7 @@ public class TestFilterMatcher {
 
     @Test
     public void testCompoundFilter() throws Exception {
-        AttributesImpl attributes = new AttributesImpl();
+        BasicAttributes attributes = new BasicAttributes();
         attributes.put("attribute1", "value1");
         attributes.put("attribute2", "value2");
 
