CAS + LDAP = 'principal' cannot be null.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

CAS + LDAP = 'principal' cannot be null.

This post has NOT been accepted by the mailing list yet.
Hi all,
I am new in CAS and still in process of understanding, please be patiente :)

I did an installation of CAS 3.5.2 and test the simple SimpleTestUsernamePasswordAuthenticationHandler and it worked flawless.
Then I move to the next authentitcacion system AcceptUsersAuthenticationHandler and worked as well with the users and pass hardcoded in the DeployerConfigContext.xml.

Finally, and what I really need to do is to connect CAS with a LDAP directory. Following the instruction from the official link
I modified the xml file adding a bean for the contextSource:
                <bean id="contextSource" class="">
                        <property name="pooled" value="false" />
                        <property name="url" value="ldap://localhost:389/" />
                        <property name="userDn" value="cn=admin,dc=westeros,dc=com" />
                        <property name="password" value="Identidad2015" />
                        <property name="anonymousReadOnly" value="false" />
                        <property name="baseEnvironmentProperties">
                                        <entry key="com.sun.jndi.ldap.connect. timeout" value="3000" />
                                        <entry key="" value="3000" />
                                        <entry key="" value="simple" />
and an extra authenticationHandler
                        <bean class="org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler"
                                        p:contextSource-ref="contextSource" />

When I restart tomcat (7), no error appeared and the context deploys normally. When I try any user and pass I get the following errors. in catalina.out
WHO: [username: jose]
WHAT: 'principal' cannot be null.
Check the correctness of @Audit annotation at the following audit point: execution(public abstract org.jasig.cas.authentication.Authentication org.jasig.cas.authentication.AuthenticationManager.authenticate(org.jasig.cas.authentication.principal.Credentials))
WHEN: Sat May 09 23:17:18 BRT 2015

in localhost.out
SEVERE: Servlet.service() for servlet [cas] in context with path [/cas-server-webapp-3.5.2] threw exception [Request processing failed; nested exception is org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing [AnnotatedAction@398b1196 targetAction = [EvaluateAction@592fac5d expression = authenticationViaFormAction.submit(flowRequestContext, flowScope.credentials, messageContext), resultExpression = [null]], attributes = map[[empty]]] in state 'realSubmit' of flow 'login' -- action execution attributes were 'map[[empty]]'] with root cause
java.lang.IllegalArgumentException: 'principal' cannot be null.

So far I couldnt find the reason why this happens, could someone help me out with this?

Thanks a lot in advance.
Reply | Threaded
Open this post in threaded view

Re: CAS + LDAP = 'principal' cannot be null.

This post has NOT been accepted by the mailing list yet.
I think I have the same problem as you. Have you checked out if you have communication between your server and ldap?

I've tried checking it out with tcdump in localhost with no luck. I lack the tools to debug this issue..

Here you have my deploy.xml conf: