Yale CAS Server 3.0.7
1. 从Yale CAS官方网上下载cas-server-jdbc-3.0.5-rc3.jar包后入入Yale CAS server的WEB-INF\lib目录下
2. 更新Yale CAS server的WEB-INF\deployerConfigContext.xml文件,配置片段如下( 本配置只进行了AuthenticationHandler替换及新增passwordEncoder、dataSource配置):
将以下:
- <bean
- class="org.jasig.cas.authentication.handler.support.MyUsernamePasswordAuthenticationHandler">
- <property
- name="passwordEncoder"
- ref="passwordEncoder"/>
- </bean>
替换成:
- <bean
- class="org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler">
- <property name="sql"
- value="select password_ from users where emailAddress=?"/>
- <property name="dataSource" ref="dataSource" />
- <property name="passwordEncoder"
- ref="passwordEncoder" />
- </bean>
然后新增:
- <bean id="passwordEncoder"
- class="org.jasig.cas.authentication.handler.LiferayPasswordEncoder" />
-
- <bean id="dataSource"
- class="org.springframework.jdbc.datasource.DriverManagerDataSource"
- destroy-method="close">
- <property name="driverClassName">
- <value>com.mysql.jdbc.Driver</value>
- </property>
- <property name="url">
- <value>
- jdbc:mysql://localhost/liferay?useUnicode=true&characterEncoding=UTF-8
- </value>
- </property>
- <property name="username">
- <value>test</value>
- </property>
- <property name="password">
- <value>test</value>
- </property>
- </bean>