1
votes

I followed the instructions at (https://wiki.jasig.org/display/CASUM/Best+Practice+-+Setting+Up+CAS+Locally+using+the+Maven2+WAR+Overlay+Method) for building the CAS server, and then the instructions for authenticating through LDAP (https://wiki.jasig.org/display/CASUM/LDAP). However, I keep getting the following error message in my Tomcat logs:

[LDAP: error code 34 - Invalid DN]; nested exception is javax.naming.InvalidNameException: [LDAP: error code 34 - Invalid DN]

I have verified that my bind user credentials are correct as I am able to perform the following search from the command line: ldapsearch -x -H ldaps://fuller.edu:636 -b "ou=People,o=fuller.edu,o=cp" -D "cn=Directory Manager" -w "password" "(sn=Smith)" cn sn pdsLoginId
The results from that search are correct and nearly instantaneous.

At this point, I'm not entirely certain what I'm missing. Below are snippets from my deployerConfigContext.xml file.

<bean class="org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler"
                                    p:filter="pdsLoginId=%u"
                                    p:searchBase="ou=People,o=fuller.edu,o=cp"
                                    p:contextSource-ref="contextSource" />
<bean id="contextSource"
class="org.springframework.ldap.core.support.LdapContextSource">
       <property name="pooled" value="true"/>
        <property name="url" value="ldaps://fuller.edu:636" />
        <property name="userDn" value="cn=Directory Manager"/>
        <property name="password" value="our password"/>
        <property name="baseEnvironmentProperties">
              <map>
                    <entry key="com.sun.jndi.ldap.connect.timeout" value="3000" />
                    <entry key="com.sun.jndi.ldap.read.timeout" value="3000" />
                    <entry key="java.naming.security.authentication" value="simple" />
              </map>
        </property>
    </bean>

I've searched through several posts here at stackoverflow.com, and tried most of the answers, but without luck. I'm hoping someone will spot what is missing in my configuration and send me in the right direction.

I'm happy to post any more code that you may need to see.

Thanks in advance.

1

1 Answers

0
votes

Your command line LDAP bind test uses the DN of "ou=People,o=our.edu,o=cp" but the config file specifies the DN of ou=People,o=edu,o=cp. Those are not the same.

o=our.edu or o=edu

Comment explained, it is ou=People,o=fuller.edu,o=cp

Next step would be to see if you need to escape the period with a backslash, so that ou=People,o=fuller.edu,o=cp which works on the command line, might beed to be ou=People,o=fuller\.edu,o=cp in the configuration file.