[ofbiz-plugins] branch release17.12 updated: Improved: Switch from jCenter to mavenCentral to handle the jCenter shutdown (OFBIZ-12171)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-plugins] branch release17.12 updated: Improved: Switch from jCenter to mavenCentral to handle the jCenter shutdown (OFBIZ-12171)

mbrohl
This is an automated email from the ASF dual-hosted git repository.

mbrohl pushed a commit to branch release17.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git


The following commit(s) were added to refs/heads/release17.12 by this push:
     new 63df767  Improved: Switch from jCenter to mavenCentral to handle the jCenter shutdown (OFBIZ-12171)
63df767 is described below

commit 63df767bee7088605c45eab68882f152fe0b9e27
Author: Michael Brohl <[hidden email]>
AuthorDate: Thu Feb 18 21:59:29 2021 +0100

    Improved: Switch from jCenter to mavenCentral to handle the jCenter
    shutdown (OFBIZ-12171)
---
 ldap/build.gradle                                                   | 2 +-
 .../activedirectory/OFBizActiveDirectoryAuthenticationHandler.java  | 6 ++++--
 .../apache/ofbiz/ldap/openldap/OFBizLdapAuthenticationHandler.java  | 6 ++++--
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/ldap/build.gradle b/ldap/build.gradle
index f57e38a..cef8a5a 100644
--- a/ldap/build.gradle
+++ b/ldap/build.gradle
@@ -18,5 +18,5 @@
  */
 
 dependencies {
-    pluginLibsCompile 'org.jasig.cas:cas-server-core:3.3.5'
+    pluginLibsCompile 'org.apereo.cas:cas-server-support-ldap-core:5.0.10'
 }
\ No newline at end of file
diff --git a/ldap/src/main/java/org/apache/ofbiz/ldap/activedirectory/OFBizActiveDirectoryAuthenticationHandler.java b/ldap/src/main/java/org/apache/ofbiz/ldap/activedirectory/OFBizActiveDirectoryAuthenticationHandler.java
index af03bf0..d8fe60a 100644
--- a/ldap/src/main/java/org/apache/ofbiz/ldap/activedirectory/OFBizActiveDirectoryAuthenticationHandler.java
+++ b/ldap/src/main/java/org/apache/ofbiz/ldap/activedirectory/OFBizActiveDirectoryAuthenticationHandler.java
@@ -29,7 +29,8 @@ import javax.naming.directory.InitialDirContext;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
-import org.jasig.cas.util.LdapUtils;
+import org.apereo.cas.util.LdapUtils;
+import org.ldaptive.LdapEntry;
 import org.apache.ofbiz.base.util.UtilXml;
 import org.apache.ofbiz.ldap.commons.AbstractOFBizAuthenticationHandler;
 import org.w3c.dom.Element;
@@ -91,7 +92,8 @@ public final class OFBizActiveDirectoryAuthenticationHandler extends AbstractOFB
             }
             String filter = UtilXml.childElementValue(rootElement, "Filter", "(objectclass=*)");
             String attribute = UtilXml.childElementValue(rootElement, "Attribute", "uid=%u");
-            attribute = LdapUtils.getFilterWithValues(attribute, username);
+            LdapEntry entry = new LdapEntry(username);
+            attribute = LdapUtils.getString(entry, attribute);
             NamingEnumeration<SearchResult> answer = ctx.search(baseDN,
                     // Filter expression
                     "(&(" + filter + ") (" + attribute +"))",
diff --git a/ldap/src/main/java/org/apache/ofbiz/ldap/openldap/OFBizLdapAuthenticationHandler.java b/ldap/src/main/java/org/apache/ofbiz/ldap/openldap/OFBizLdapAuthenticationHandler.java
index 31be257..2fd2e63 100644
--- a/ldap/src/main/java/org/apache/ofbiz/ldap/openldap/OFBizLdapAuthenticationHandler.java
+++ b/ldap/src/main/java/org/apache/ofbiz/ldap/openldap/OFBizLdapAuthenticationHandler.java
@@ -27,7 +27,8 @@ import javax.naming.directory.DirContext;
 import javax.naming.directory.InitialDirContext;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
-import org.jasig.cas.util.LdapUtils;
+import org.apereo.cas.util.LdapUtils;
+import org.ldaptive.LdapEntry;
 import org.apache.ofbiz.base.util.UtilXml;
 import org.apache.ofbiz.ldap.commons.AbstractOFBizAuthenticationHandler;
 import org.w3c.dom.Element;
@@ -76,7 +77,8 @@ public final class OFBizLdapAuthenticationHandler extends AbstractOFBizAuthentic
             }
             String filter = UtilXml.childElementValue(rootElement, "Filter", "(objectclass=*)");
             String attribute = UtilXml.childElementValue(rootElement, "Attribute", "uid=%u");
-            attribute = LdapUtils.getFilterWithValues(attribute, username);
+            LdapEntry entry = new LdapEntry(username);
+            attribute = LdapUtils.getString(entry, attribute);
             NamingEnumeration<SearchResult> answer = ctx.search(baseDN,
                     // Filter expression
                     "(&(" + filter + ") (" + attribute +"))",