nugao

博客园 首页 新随笔 联系 订阅 管理

配置内容同一样,只是增加一些配置。

因为cas已经默认就支持MD5加密验证,所以只是修改一下配置就可以了。

 

<bean id="primaryAuthenticationHandler" class="org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler">

      <property name="dataSource" ref="dataSource" />

      <property name="sql" value="select password from table_users where username = ?" />

</bean>

增加一条内容

<bean id="primaryAuthenticationHandler" class="org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler">

      <property name="dataSource" ref="dataSource" />

      <property name="sql" value="select password from table_users where username = ?" />

      <property name="passwordEncoder" ref="passwordEncoder" />

</bean>

 
另外再在下面增加一条属性
<bean id="passwordEncoder" class="org.jasig.cas.authentication.handler.DefaultPasswordEncoder" p:characterEncoding="UTF-8" >
       <constructor-arg index="0" value="MD5" />
</bean>
 
 
 
完整的内容是:
<bean id="primaryAuthenticationHandler" class="org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler">
      <property name="dataSource" ref="dataSource" />
      <property name="sql" value="select password from table_users where username = ?" />
      <property name="passwordEncoder" ref="passwordEncoder" />
</bean>
<bean id="passwordEncoder" class="org.jasig.cas.authentication.handler.DefaultPasswordEncoder" p:characterEncoding="UTF-8" >
       <constructor-arg index="0" value="MD5" />
</bean>

 

posted on 2014-06-12 17:39  nugao  阅读(491)  评论(0编辑  收藏  举报