diff --git a/pom.xml b/pom.xml index 599c5de..d929183 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 net.wimpi.crowd.ldap crowd-ldap-server - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT jar Crowd-LDAP-Server diff --git a/run.sh b/run.sh index c0e83e8..66c58c1 100755 --- a/run.sh +++ b/run.sh @@ -1,5 +1,5 @@ #!/bin/sh -JAR=target/crowd-ldap-server-1.0-SNAPSHOT.jar +JAR=target/crowd-ldap-server-1.0.2-SNAPSHOT.jar # Apache DS Settings FIXADS="-Duser.language=en -Duser.country=US" diff --git a/src/main/java/net/wimpi/crowd/ldap/CrowdPartition.java b/src/main/java/net/wimpi/crowd/ldap/CrowdPartition.java index 6abab18..182eae4 100644 --- a/src/main/java/net/wimpi/crowd/ldap/CrowdPartition.java +++ b/src/main/java/net/wimpi/crowd/ldap/CrowdPartition.java @@ -264,12 +264,18 @@ public boolean hasEntry(EntryOperationContext ctx) throws UserNotFoundException, log.error("hasEntry()", ex); } log.debug("Prefix=" + prefix); - if (isCrowdGroups(prefix) || isCrowdUsers(prefix)) { + if (isCrowdUsers(prefix)) { RDN rdn = dn.getRdn(2); String user = rdn.getNormValue(); log.debug("user=" + user); ServerEntry userEntry = createUserEntry(dn); return (userEntry != null); + } else if(isCrowdGroups(prefix)) { + RDN rdn = dn.getRdn(2); + String group = rdn.getNormValue(); + log.debug("group=" + group); + ServerEntry groupEntry = createGroupEntry(dn); + return (groupEntry != null); } else { log.debug("Prefix is neither users nor groups"); log.debug("Crowd Users = " + m_CrowdUsersEntry.getDn()); diff --git a/testAuth.sh b/testAuth.sh index 3a1cbee..4f3ab4c 100755 --- a/testAuth.sh +++ b/testAuth.sh @@ -1,3 +1,5 @@ #!/bin/bash -USER_UID= +USER_UID=$1 +GROUP_ID=$2 ldapsearch -v -x -D 'uid='${USER_UID}',ou=users,dc=crowd' -W -H ldap://localhost:10389 -b ou=users,dc=crowd uid=${USER_UID} +ldapsearch -WxD "uid=${USER_UID},ou=users,dc=crowd" -H ldap://localhost:10389 -b "dn=${GROUP_ID},ou=groups,dc=crowd"