The following is what you need to do; to get your CAS server authenticate against Databases instead of default inMemory Authentication:-
- Copy the following (ommons-collections-3.2.jar, commons-dbcp-1.2.1.jar,commons-pool-1.3.jar) jars to your cas/web-inf/lib/
- Copy your DataBase driver (ojdbc14.jar) to cas/web-inf/lib/
- then edit your cas/web-inf/deployerConfigContext.xml to be as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<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" />
<bean class="org.acegisecurity.adapters.cas3.CasAuthenticationHandler">
<property name="authenticationManager" ref="acegiAuthenticationManager" />
</bean-->
<bean id="SearchModeSearchDatabaseAuthenticationHandler"
class="org.jasig.cas.adaptors.jdbc.SearchModeSearchDatabaseAuthenticationHandler"
abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default">
<property name="tableUsers">
<!-- USER_TABLE-->
<value>SF_INF_USERS</value>
</property>
<property name="fieldUser">
<!-- USERR_NAME Column Name -->
<value>NAME</value>
</property>
<property name="fieldPassword">
<!-- PASSWORD Column Name -->
<value>PSWD</value>
</property>
<property name="dataSource" ref="dataSource" />
</bean>
</list>
</property>
</bean>
<!-- the old inMemory Authentication -->
<!--bean id="inMemoryDaoImpl" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
<property name="userMap">
<value>
aabdelaziz=aabdelaziz,EPS_SYSTEM_ADMIN
marissa=koala,ROLES_IGNORED_BY_CAS
dianne=emu,ROLES_IGNORED_BY_CAS
scott=wombat,ROLES_IGNORED_BY_CAS
peter=opal,disabled,ROLES_IGNORED_BY_CAS
</value>
</property>
</bean>
<bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
<property name="userDetailsService"><ref bean="inMemoryDaoImpl"/></property>
</bean>
<bean id="acegiAuthenticationManager" class="org.acegisecurity.providers.ProviderManager">
<property name="providers">
<list>
<ref bean="daoAuthenticationProvider"/>
</list>
</property>
</bean-->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="url">
<value>jdbc:oracle:thin:@10.1.119.76:1521:epsdb</value>
</property>
<property name="username">
<value>eps</value>
</property>
<property name="password">
<value>eps</value>
</property>
</bean>
</beans>Â
Refrences:
http://www.ja-sig.org/wiki/display/CASUM/Using+JDBC+for+Authentication

Recent comments
1 week 4 hours ago
2 weeks 1 day ago
2 weeks 3 days ago
2 weeks 5 days ago
3 weeks 2 hours ago
3 weeks 3 days ago
3 weeks 3 days ago
5 weeks 2 days ago
10 weeks 4 hours ago
10 weeks 5 hours ago