Update LDAP library to fix auth filter bug
This commit is contained in:
@@ -227,8 +227,6 @@ key.path: '/path/to/sign.key'
|
|||||||
#
|
#
|
||||||
# Example: (memberOf=CN=Matrix Users,CN=Users,DC=example,DC=org)
|
# Example: (memberOf=CN=Matrix Users,CN=Users,DC=example,DC=org)
|
||||||
#
|
#
|
||||||
# /!\ Currently NOT supported due to a possible bug in LDAP library /!\
|
|
||||||
#
|
|
||||||
#ldap.auth.filter: ''
|
#ldap.auth.filter: ''
|
||||||
|
|
||||||
|
|
||||||
|
@@ -83,7 +83,7 @@ dependencies {
|
|||||||
compile 'net.i2p.crypto:eddsa:0.1.0'
|
compile 'net.i2p.crypto:eddsa:0.1.0'
|
||||||
|
|
||||||
// LDAP connector
|
// LDAP connector
|
||||||
compile 'org.apache.directory.api:api-all:1.0.0-RC2'
|
compile 'org.apache.directory.api:api-all:1.0.0'
|
||||||
|
|
||||||
// DNS lookups
|
// DNS lookups
|
||||||
compile 'dnsjava:dnsjava:2.1.8'
|
compile 'dnsjava:dnsjava:2.1.8'
|
||||||
|
@@ -64,6 +64,9 @@ public class LdapAuthProvider extends LdapGenericBackend implements Authenticato
|
|||||||
MatrixID mxIdExt = new MatrixID(id);
|
MatrixID mxIdExt = new MatrixID(id);
|
||||||
String userFilterValue = StringUtils.equals(LdapThreePidProvider.UID, uidType) ? mxIdExt.getLocalPart() : mxIdExt.getId();
|
String userFilterValue = StringUtils.equals(LdapThreePidProvider.UID, uidType) ? mxIdExt.getLocalPart() : mxIdExt.getId();
|
||||||
String userFilter = "(" + getCfg().getAttribute().getUid().getValue() + "=" + userFilterValue + ")";
|
String userFilter = "(" + getCfg().getAttribute().getUid().getValue() + "=" + userFilterValue + ")";
|
||||||
|
if (!StringUtils.isBlank(getCfg().getAuth().getFilter())) {
|
||||||
|
userFilter = "(&" + getCfg().getAuth().getFilter() + userFilter + ")";
|
||||||
|
}
|
||||||
EntryCursor cursor = conn.search(getCfg().getConn().getBaseDn(), userFilter, SearchScope.SUBTREE, getUidAttribute(), getCfg().getAttribute().getName());
|
EntryCursor cursor = conn.search(getCfg().getConn().getBaseDn(), userFilter, SearchScope.SUBTREE, getUidAttribute(), getCfg().getAttribute().getName());
|
||||||
try {
|
try {
|
||||||
while (cursor.next()) {
|
while (cursor.next()) {
|
||||||
|
Reference in New Issue
Block a user