Hello,

i've installed CAS SSO (cas-server-3.3-release.tar.gz) on one of our
linux based servers. Its working when when i use a text-based
authenticator or the testauthenticator
(<bean
class="org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler"
/>)

Now i want to use a database using jdbc to check to check username and
password like described in
http://www.ja-sig.org/wiki/display/CASUM/Using+JDBC+for+Authentication

My problem is i can't figure out why its not working.

I copied the following files to WEB-INF/lib/
- cas-server-support-jdbc-3.3.jar
- cas-server-support-generic-3.3.jar
- commons-dbcp-1.2.1.jar
- commons-pool-1.2.jar
- commons-collections-3.1.jar
- mysql-connector-java-5.1.6-bin.jar

where a part of my cas.log file
2008-09-01 14:30:43,580 ERROR
[org.springframework.web.context.ContextLoader] - Context initialization
failed
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'centralAuthenticationService' defined in ServletContext
resource [/WEB-INF/spring-configuration/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
'SearchModeSearchDatabaseAuthenticationHandler' of type
[org.jasig.cas.adaptors.jdbc.SearchModeSearchDatabaseAuthenticationHandler]
while setting bean property 'authenticationHandlers' with key [1];
nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'SearchModeSearchDatabaseAuthenticationHandler' defined
in ServletContext resource [/WEB-INF/deployerConfigContext.xml]:
Initialization of bean failed; nested exception is
java.lang.NoClassDefFoundError:
org/springframework/jdbc/core/simple/SimpleJdbcTemplate
        at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
        at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
        at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
        at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
        at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
        at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
        at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
        at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
        at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
        at
org.jasig.cas.web.init.SafeContextLoaderListener.contextInitialized(SafeContextLoaderListener.java:62)
        at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
        at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
        at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
        at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
        at
org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:448)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)


Heres the part of WEB-INF/deployerConfigContext.xml i modified

                <property name="authenticationHandlers">
                        <list>
                                <!--
                                        | This is the authentication
handler that authenticates services by means of callback via SSL,
thereby validating
                                        | a server side SSL certificate.
                                        +-->
                                <bean
class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
                                        p:httpClient-ref="httpClient" />
                                <!--
                                        | This is the authentication
handler declaration that every CAS deployer will need to change before
deploying CAS
                                        | into production.  The default
SimpleTestUsernamePasswordAuthenticationHandler authenticates
UsernamePasswordCredentials
                                        | where the username equals the
password.  You will need to replace this with an AuthenticationHandler
that implements your
                                        | local authentication
strategy.  You might accomplish this by coding a new such handler and
declaring
                                        |
edu.someschool.its.cas.MySpecialHandler here, or you might use one of
the handlers provided in the adaptors modules.
                                        +-->
                                <bean
id="SearchModeSearchDatabaseAuthenticationHandler"
class="org.jasig.cas.adaptors.jdbc.SearchModeSearchDatabaseAuthenticationHandler">
                                        <property  name="tableUsers">
                                                <value>ssoUser</value>
                                        </property>
                                        <property name="fieldUser">
                                                <value>uId</value>
                                        </property>
                                        <property name="fieldPassword">
                                                <value>uPasswd</value>
                                        </property>
                                        <property name="dataSource"
ref="dataSource" />
                                </bean>
                        </list>
                </property>
        </bean>

        <bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
         <property name="driverClassName">
          <value>com.mysql.jdbc.Driver</value>
         </property>
         <property name="url">
         
<value>jdbc:mysql://localhost:3306/casSSO?autoReconnect=true</value>
         </property>
         <property name="username">
          <value></value>
         </property>
         <property name="password">
          <value></value>
         </property>
        </bean>


Maybe someone can help me.

Best regards
Joerg
_______________________________________________
Yale CAS mailing list
[email protected]
http://tp.its.yale.edu/mailman/listinfo/cas

Reply via email to