CAS5.2x使用Oracle數據庫

一、首先確保CAS系統能夠使用casuser::Mellon來正常訪問,如下圖所示
 

 二、在pom文件中加入對應的依賴:
 

<dependency>
  <groupId>com.oracle</groupId>
  <artifactId>ojdbc6</artifactId>
  <version>1.0.0</version>
</dependency>

<dependency>
  <groupId>org.apereo.cas</groupId>
  <artifactId>cas-server-support-jdbc</artifactId>
  <version>${cas.version}</version>
</dependency>

注:該Oracle驅動是自己"安裝"在本地的maven中,因遠程庫的無法使用
安裝方法(需要自己做相應的修改):mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=1.0.0 -Dpackaging=jar -Dfile=E:/DevelopLanguage/ojdbc6.jar


三、配置properties文件:

cas.authn.jdbc.query[0].passwordEncoder.type=DEFAULT
cas.authn.jdbc.query[0].passwordEncoder.characterEncoding=UTF-8
cas.authn.jdbc.query[0].passwordEncoder.encodingAlgorithm=MD5

cas.authn.jdbc.query[0].url=jdbc:oracle:thin:@127.0.0.1:1521:orcl
cas.authn.jdbc.query[0].user=root
cas.authn.jdbc.query[0].password=root
cas.authn.jdbc.query[0].sql=select * from CAS_USER where username = ?
cas.authn.jdbc.query[0].fieldPassword=password
cas.authn.jdbc.query[0].driverClass=oracle.jdbc.driver.OracleDriver

四、登錄成功

------數據庫表數據:
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章