Cas_Server端安裝

 
 
1、Cas Server版本:3.5.2
 
2、安裝步驟:
一、解壓cas-server-3.5.2.zip並部署到tomcat下
二、運行tomcat站點,進入登陸頁面(默認端口爲8080)
三、建立數據庫及用戶表

    a) 建立數據庫:ssomysql

    b) 建立用戶表並初始化用戶spring

1
2
3
4
5
6
7
8
9
10
11
CREATE  TABLE  `app_user` ( 
   `username`  varchar (30)  NOT  NULL  default  ''
   ` password varchar (45)  NOT  NULL  default  ''
   PRIMARY  KEY   (`username`) 
) ENGINE=InnoDB  DEFAULT  CHARSET=utf8; 
-- 並添加以下用戶: 
INSERT  INTO  `app_user` (`username`,` password `)  VALUES  
  ( 'test' , '111' ), 
  ( 'user' , '222' ), 
  ( 'tom' , '333' ), 
  ( 'jim' , '000' );
四、修改配置文件 deployerConfigContext.xml
     a)、註銷bean:org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler並用新代碼替換
1
2
3
4
5
6
7
8
<!--
<bean
    class="org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler" />
-->  
< bean class = "org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler" >
    < property name = "sql" value = "select password from app_user where username=?" />
    < property name = "dataSource" ref = "dataSource" />
</ bean >

     b)、beans節點下添加bean:dataSourcesql

1
2
3
4
5
6
< bean id = "dataSource" class = "org.springframework.jdbc.datasource.DriverManagerDataSource" >
     < property name = "driverClassName" >< value >com.mysql.jdbc.Driver</ value ></ property >
     < property name = "url" >< value >jdbc:mysql://127.0.0.1:3306/sso</ value ></ property >
     < property name = "username" >< value >root</ value ></ property >
     < property name = "password" >< value >123456</ value ></ property >
</ bean >

五、重啓tomcat數據庫

cd /bin     ./shutdown.sh    ./startup.shtomcat

 

六、登陸服務器:使用3.b步中插入的 服務器


 

 

3、可能遇到的問題:
app

一、登陸時提示:Non-Secure-Connectionurl


解決方法:註銷相關代碼便可spa


 

二、帳號密碼正確可是一直報驗證錯誤:重啓tomcat便可.net

相關文章
相關標籤/搜索