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.

jacortijo
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
https://wiki.jasig.org/display/CASUM/LDAP
I modified the xml file adding a bean for the contextSource:
                <bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource">
                        <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">
                                <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>
and an extra authenticationHandler
                        <bean class="org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler"
                                        p:filter="uid=%u"
                                        p:searchBase="ou=empleados,dc=westeros,dc=com"
                                        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))
ACTION: TICKET_GRANTING_TICKET_NOT_CREATED
APPLICATION: CAS
WHEN: Sat May 09 23:17:18 BRT 2015
CLIENT IP ADDRESS: 127.0.0.1
SERVER IP ADDRESS: 127.0.0.1
=============================================================

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.
Jose
Reply | Threaded
Open this post in threaded view
|

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

vacin
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:

http://pastebin.com/jQjxy3DD