CAS 5.0.3.1部署
1.环境资源准备
- Tomcat 8.0
- JDK 1.8
- IntelliJ IDEA
- CAS 5.0.3.1 Gradle Overlay 下载地址
2.编译war包
IDEA 打开解压出的 cas-gradle-overlay-template-master
Bulid – Build Artifact – …cas.war(exploded) – Build
cas – build – libs – exploded – cas.war – WEB-INF – lib – cas-server-webapp-5.0.3.1.war
复制粘贴到Tomcat下的webapp中并改名 cas.war
运行 Tomcat
浏览器访问http://127.0.0.1:8080/cas/login
输入系统默认用户名:casuser 密码:Mellon
出现以下界面则成功
3.启用Mongodb
cas – build.gradle – dependencies 里添加以下代码
compile "org.apereo.cas:cas-server-support-mongo:${project.'cas.version'}"
右侧 Gradle – Refresh
然后 Build Artifact
把 lib 下除了cas-server-webapp-5.0.3.1.war 以外的所有 jar 包复制粘贴到 tomcat webapp 下 cas\WEB-INF\lib 的下面 (Tomcat根据 cas.war 自动解压出的)
修改 webapp\cas\WEB-INF\classes\application.properties
用#号注释掉
# cas.authn.accept.users=casuser::Mellon
添加
cas.authn.mongo.mongoHostUri=mongodb://127.0.0.1:27017/demo cas.authn.mongo.usernameAttribute=username cas.authn.mongo.attributes=username,password cas.authn.mongo.passwordAttribute=password cas.authn.mongo.collectionName=user
参见官方文档 MongoDb Authentication
Mongodb新建数据库: demo 新建Collection:user
添加Document:
{ "username" : "admin", "password" : "123456" }
启动Tomcat 使用 admin 123456 登录
- 转载请附原文链接 http://blog.csdn.net/q981553477/article/details/60877363