Research and analysis of single sign-on Ja-sig

Source: Internet
Author: User
Tags cas ldap
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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.