Connecting CAS 3.1.1 to LDAP
Scott Battaglia
scott.battaglia at gmail.com
Wed Jan 16 11:06:44 EST 2008
We need to see the exception that is being thrown at startup or we can't
debug. Check the cas.log
On Jan 16, 2008 10:53 AM, Zach Seifts <zach.seifts at cpcc.edu> wrote:
> Okay, I wasn't sure about that part. I'm still getting that same error
> when trying to start it in tomcat. But when I'm deploying it I'm now getting
> this in the logs:
>
> Jan 16, 2008 10:28:33 AM org.apache.catalina.startup.HostConfig deployWAR
> INFO: Deploying web application archive cas-server-webapp-3.1.1.war
> Jan 16, 2008 10:28:34 AM org.apache.catalina.core.StandardContext start
> SEVERE: Error filterStart
> Jan 16, 2008 10:28:34 AM org.apache.catalina.core.StandardContext start
> SEVERE: Context [/cas-server-webapp-3.1.1] startup failed due to previous
> errors
>
> -Zach
>
>
>
>
> ------------------------------
>
> Zach Seifts
> Central Piedmont Community College
> 704.330.6988
> zach.seifts at cpcc.edu
>
>
> Scott Battaglia wrote:
>
> Yes, your error message indicates that you have included the correct
> jars. After you deployed the changes that Andrew and I suggested, did the
> error message change (you have not included it).
>
> -Scott
>
> On Jan 16, 2008 9:30 AM, Zach Seifts <zach.seifts at cpcc.edu> wrote:
>
> > Scott and Andrew,
> >
> > I've tried that both ways and was unable to get it to start up. I'm
> > kinda curious, am I understanding the tutorial when it says all you have to
> > do is include the dependency directive in the pom.xml to have CAS
> > include the LDAP part? Or do I have to copy one of the jars somewhere?
> >
> > Thanks for your help.
> > Zach
> >
> >
> >
> > ------------------------------
> >
> > Zach Seifts
> > Central Piedmont Community College
> > 704.330.6988
> > zach.seifts at cpcc.edu
> >
> >
> > Scott Battaglia wrote:
> >
> > Andrew is correct. That should fix the problem.
> >
> > It can be shortened to <property name="contextSource"
> > ref="contextSource" />
> >
> > -Scott
> >
> > On Jan 11, 2008 3:34 PM, Andrew Petro < apetro at unicon.net> wrote:
> >
> > > Zach,
> > >
> > > It looks to me like you have a slight error in your Spring XML configuration here.
> > >
> > > <bean class="org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler
> > > ">
> > >
> > > <property name="contextSource" value="contextSource" />
> > >
> > > </bean>
> > >
> > >
> > >
> > >
> > >
> > >
> > > What this says is "Hey, Spring, there's a property named
> > > "contextSource", please set it to the value "contextSource", like so:
> > >
> > >
> > > BindLdapAuthenticationHandler
> > > handler = new BindLdapAuthenticationHandler();
> > > handler.setContextSource("contextSource");
> > >
> > >
> > > This doesn't work for the
> > > reason one might expect: the setContextSource() method takes an
> > > argument of type ContextSource, not an argument of type String. That's
> > > what this error message is trying to say:
> > >
> > >
> > >
> > > "java.lang.IllegalArgumentException:
> > > Cannot convert value of type [java.lang.String] to required type [
> > >
> > > org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource] for
> > > property 'contextSource': no matching editors or conversion strategy
> > > found"
> > >
> > >
> > > You've defined a bean *named*
> > > contextSource soon following in the configuration. This property
> > > declaration needs to *reference* that bean.
> > >
> > >
> > >
> > >
> > > <property name="contextSource">
> > >
> > > <ref
> > > bean="contextSource"/>
> > >
> > >
> > > </property>
> > >
> > >
> > >
> > > Andrew
> > >
> > >
> > > Andrew Petro
> > > Unicon, Inc. = A JA-SIG
> > > commercial affiliate offering services, support, and training for open
> > > source software in education.
> > >
> > >
> > >
> > >
> > > On Jan 11, 2008, at 12:08 PM, Zach Seifts wrote:
> > >
> > > Adam,
> > >
> > > I tried adding "https://" to the url of my ad server and it's still
> > > giving me the same error message. I'm wondering if its not able to locate
> > > BindLdapAuthenticationHandler or something of that nature; the dependency is
> > > in cas-server-webapp/pom.xml.
> > >
> > > Cheers
> > > Zach
> > >
> > >
> > >
> > > ------------------------------
> > >
> > > Zach Seifts
> > > Central Piedmont Community College
> > > 704.330.6988
> > > zach.seifts at cpcc.edu
> > >
> > >
> > > Adam Rybicki wrote:
> > >
> > > Zach,
> > >
> > > That needs to be a full URL. Also, since you have SSL enabled for
> > > accessing LDAP, I think that your URL should start with ldaps:// rather than
> > > ldap://. If you are using the default port number, 389 for ldap and
> > > 636 for ldaps, you shouldn't have to specify the port number in the URL.
> > >
> > > Adam
> > >
> > > Zach Seifts wrote:
> > >
> > > Hey everyone,
> > >
> > > I'm having some trouble trying to setup a cas3 server which connects
> > > to MS-AD with LDAP (running on etch's tomcat). I've been following the LDAP
> > > tutorial on the ja-sig wiki and after everything is configured the way it
> > > says in the tutorial, I compile and deploy the war file to tomcat and it
> > > won't start up. The logs tell me i have errors in my
> > > deployerConfigContext.xml which leads me to think my something in the
> > > contextSource bean isn't configured correctly. I don't have "ldap://"in front of the server name in the urls property, do I need that? Any
> > > insight would be helpful.
> > >
> > > Cheers
> > > Zach
> > >
> > > Logs:
> > >
> > > 2008-01-10 10:40:37,494 ERROR [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/cas-server-webapp-3.1.1
> > > ]] - <Exception starting filter Acegi Filter Chain Proxy>
> > >
> > > org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'centralAuthenticationService' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean 'authenticationManager' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationManager' defined in ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Cannot create inner bean 'org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler#1416de4' of type [org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler] while setting bean property 'authenticationHandlers' with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler#1416de4' defined in ServletContext resource
> > >
> > > [/W
> > > EB-INF/deployerConfigContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource
> > >
> > > ] for property 'contextSource'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type[org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource
> > >
> > > ] for property 'contextSource': no matching editors or conversion strategy found
> > >
> > > Caused by:
> > >
> > > org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationManager' defined in ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Cannot create inner bean 'org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler#1416de4' of type [org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler] while setting bean property 'authenticationHandlers' with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler#1416de4' defined in ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource] for property 'contextSource'; nested
> > >
> > > exc
> > > eption is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource] for property 'contextSource': no matching editors or con version strategy found
> > >
> > > Caused by:
> > >
> > > org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler#1416de4' defined in ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException
> > >
> > > : Failed to convert property value of type [java.lang.String] to required type [org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource] for property 'contextSource'; nested exception is java.lang.IllegalArgumentException
> > >
> > > : Cannot convert value of type [java.lang.String] to required type [org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource] for property 'contextSource': no matching editors or conversion strategy found
> > >
> > > Caused by:
> > >
> > > org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource] forproperty 'contextSource'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource] for property 'contextSource': no matching editors or conversion strategy found
> > >
> > >
> > > Caused by:
> > >
> > > java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource
> > >
> > > ] for property 'contextSource': no matching editors or conversion strategy found
> > >
> > >
> > >
> > > deployerConfigContext.xml:
> > >
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > >
> > > <beans xmlns="http://www.springframework.org/schema/beans" <http://www.springframework.org/schema/beans>
> > >
> > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <http://www.w3.org/2001/XMLSchema-instance>
> > >
> > > xmlns:p="http://www.springframework.org/schema/p" <http://www.springframework.org/schema/p>
> > >
> > >
> > > xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd" <http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-2.0.xsd>>
> > >
> > > <bean id="authenticationManager"
> > >
> > > class="org.jasig.cas.authentication.AuthenticationManagerImpl
> > > ">
> > >
> > > <property name="credentialsToPrincipalResolvers">
> > >
> > > <list>
> > >
> > > <bean class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver" />
> > >
> > >
> > > <bean class="org.jasig.cas.authentication.principal.HttpBasedServiceCredentialsToPrincipalResolver" />
> > >
> > > </list>
> > >
> > > </property>
> > >
> > > <property name="authenticationHandlers">
> > >
> > > <list>
> > >
> > > <bean class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler
> > > "
> > > p:httpClient-ref="httpClient" />
> > >
> > > <bean class="org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler
> > > ">
> > >
> > > <property name="filter" value="uid=%u" />
> > >
> > >
> > > <property name="searchBase" value="cn=XXXXX,dc=XXXX,dc=XXXX" />
> > >
> > > <property name="contextSource" value="contextSource" />
> > >
> > > </bean>
> > >
> > > </list>
> > >
> > >
> > > </property>
> > >
> > > </bean>
> > >
> > > <bean id="contextSource" class="org.jasig.cas.adpators.ldap.util.AuthenticatedLdapContextSource">
> > >
> > > <property name="urls">
> > >
> > >
> > > <list>
> > >
> > > <value>XXXXXXXXXXXXXXXX</value>
> > >
> > > </list>
> > >
> > > </property>
> > >
> > > <property name="userName" value="XXXXXXX" />
> > >
> > > <property name="password" value="XXXXXXX" />
> > >
> > > <property name="baseEnvironmentProperties"> <property name="ignorePartialResultException" value="yes" />
> > >
> > > <map>
> > >
> > > <entry>
> > >
> > >
> > > <key><value>java.naming.security.protocol</value></key>
> > >
> > > <value>ssl</value>
> > >
> > > </entry>
> > >
> > > <entry>
> > >
> > >
> > > <key><value>java.naming.security.authentication</value></key>
> > >
> > > <value>simple</value>
> > >
> > > </entry>
> > >
> > > </map>
> > >
> > >
> > > </property>
> > >
> > > </bean>
> > >
> > > <bean id="userDetailsService" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
> > >
> > > <property name="userMap">
> > >
> > >
> > > <value>
> > >
> > > </value>
> > >
> > > </property>
> > >
> > > </bean>
> > >
> > > <bean id="attributeRepository"
> > >
> > >
> > > class="org.jasig.services.persondir.support.StubPersonAttributeDao">
> > >
> > > <property name="backingMap">
> > >
> > > <map>
> > >
> > > <entry key="uid" value="uid" />
> > >
> > > </map>
> > >
> > > </property>
> > >
> > >
> > > </bean>
> > >
> > > <bean
> > >
> > > id="serviceRegistryDao"
> > >
> > >
> > > class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl" />
> > >
> > > </beans>
> > >
> > > --
> > >
> > >
> > > _______________________________________________
> > > Yale CAS mailing list
> > > cas at tp.its.yale.edu
> > > http://tp.its.yale.edu/mailman/listinfo/cas
> > >
> > >
> >
> >
> > --
> > -Scott Battaglia
> >
> > LinkedIn: http://www.linkedin.com/in/scottbattaglia
> >
> > ------------------------------
> >
> > _______________________________________________
> > Yale CAS mailing listcas at tp.its.yale.eduhttp://tp.its.yale.edu/mailman/listinfo/cas
> >
> >
> > _______________________________________________
> > Yale CAS mailing list
> > cas at tp.its.yale.edu
> > http://tp.its.yale.edu/mailman/listinfo/cas
> >
> >
>
>
> --
> -Scott Battaglia
>
> LinkedIn: http://www.linkedin.com/in/scottbattaglia
>
> ------------------------------
>
> _______________________________________________
> Yale CAS mailing listcas at tp.its.yale.eduhttp://tp.its.yale.edu/mailman/listinfo/cas
>
>
> _______________________________________________
> Yale CAS mailing list
> cas at tp.its.yale.edu
> http://tp.its.yale.edu/mailman/listinfo/cas
>
>
--
-Scott Battaglia
LinkedIn: http://www.linkedin.com/in/scottbattaglia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tp.its.yale.edu/pipermail/cas/attachments/20080116/c0984c8a/attachment.html
More information about the cas
mailing list