Posted by
mbrohl on
URL: http://ofbiz.116.s1.nabble.com/ofbiz-plugins-branch-release18-12-updated-Improved-Switch-from-jCenter-to-mavenCentral-to-handle-the-tp4766054.html
This is an automated email from the ASF dual-hosted git repository.
mbrohl pushed a commit to branch release18.12
in repository
https://gitbox.apache.org/repos/asf/ofbiz-plugins.gitThe following commit(s) were added to refs/heads/release18.12 by this push:
new a356edc Improved: Switch from jCenter to mavenCentral to handle the jCenter shutdown (OFBIZ-12171)
a356edc is described below
commit a356edc9b773faedf554880c397bec4bd6e5b2b8
Author: Michael Brohl <
[hidden email]>
AuthorDate: Sun Feb 14 01:05:33 2021 +0100
Improved: Switch from jCenter to mavenCentral to handle the jCenter
shutdown (OFBIZ-12171)
See comments in framework build.gradle for details.
---
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..dc42725 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,9 +29,10 @@ import javax.naming.directory.InitialDirContext;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
-import org.jasig.cas.util.LdapUtils;
import org.apache.ofbiz.base.util.UtilXml;
import org.apache.ofbiz.ldap.commons.AbstractOFBizAuthenticationHandler;
+import org.apereo.cas.util.LdapUtils;
+import org.ldaptive.LdapEntry;
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 +"))",