First, the database configuration
1. Complex database-driven jar files to the Lib directory of the CAS service-side web site
2. Modify the Casserver/web-inf/deployerconfigcontext.xml file:
<!--comment out the following code-->
<bean class= "Org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler"/ >
Replace with:
<bean class= "Org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler" >
<property name= "SQL" value= "select Password_ from Id_user where name_=?" />
<property name= "Passwordencoder" ref= "Passwordencoder"/>
<property name= "DataSource" ref= "DataSource"/>
</bean>
At the end of the file, add:
<!--data Source definition-->
<bean id= "DataSource"
class= "Org.springframework.jdbc.datasource.DriverManagerDataSource" >
<property name= "Driverclassname" value= "${db.driver}"/>
<property name= "url" value= "${db.url}"/>
<property name= "username" value= "${db.username}"/>
<property name= "Password" value= "${db.password}"/>
</bean>
<bean id= "Passwordencoder"
Class= "Org.jasig.cas.authentication.handler.DefaultPasswordEncoder"
Autowire= "ByName" >
<constructor-arg value= "MD5"/>
</bean>
To add in the Casserver/web-inf/cas.properties file:
Database.hibernate.dialect=org.hibernate.dialect.oracledialect
#database. Hibernate.dialect=org.hibernate.dialect.mysqldialect
#database. Hibernate.dialect=org.hibernate.dialect.hsqldialect
Db.driver=oracle.jdbc.driver.oracledriver
db.url=jdbc/:oracle/:thin/: @localhost/:1521/:master
Db.username=casusername
Db.password=caspwd
Second, LDAP configuration
1. Complex Cas-server-support-ldap-3.2.jar files to the Lib directory of the CAS service-side web site
2. Modify the Casserver/web-inf/deployerconfigcontext.xml file:
<!--comment out the following code-->
<bean class= "Org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler"/ >
Replace with: (Note: location)
<bean
class= "Com.jihong.cas.adaptors.ldap.BindLdapAuthenticationHandler" >
<property name= "Filter" value= "uid=%u"/>
<!--base node-->
<property name= "Searchbase"
value= "ou= unit, O=tjju"/>
<property name= "Contextsource" ref= "Contextsource"/>
</bean>
At the end of the file, add:
<bean id= "Contextsource"
class= "Org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource" >
<property name= "password" value= "secret"/>
<property name= "Pooled" value= "true"/>
<property name= "URLs" >
<list>
<value>ldap://192.168.0.1:389/</value>
</list>
</property>
<!--property Name= "UserName" value= "Uid=admin,o=tjju"/-->
<property name= "Baseenvironmentproperties" >
<map>
<entry>