This demo app use Database-Authentication(QueryDatabaseAuthenticationHandler) to authentication.
- Create a directory to for cas config files,e.g.
D:\var\temp\cas-conf
- Copy
cas.properties
(in {YOUR_PROJECT_DIR}/etc/) toD:\var\temp\cas-conf
If you want use another path,you need to edit propertyFileConfigurer.xml file(in src/main/webapp/WEB-INF/spring-configuration)
- edit
cas.properties
(inD:\var\temp\cas-conf
),values need to change:
- database.url : database connection string
- database.user:user name(database)
- database.password:password(database)
- create database schema and table
CREATE SCHEMA `cas-user-db` DEFAULT CHARACTER SET latin1 ;
CREATE TABLE `cas-user-db`.`users` (
`user_name` VARCHAR(32) NOT NULL COMMENT 'the user\'s id',
`user_email` VARCHAR(128) NULL COMMENT '',
`user_pwd` VARCHAR(256) NOT NULL COMMENT 'password,plain text',
`create_timestamp` DATETIME NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
PRIMARY KEY (`user_name`) COMMENT '')
COMMENT = 'user table';
- insert data (to test)
INSERT INTO `cas-user-db`.`users` (`user_name`, `user_pwd`) VALUES ('john', '123456');
- Run CAS Server
- CAS will be available at: http://127.0.0.1:8080/cas
- use john/123456 (username and password) to test login