CAS 5.0.3.1部署

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

  • BulidBuild Artifact…cas.war(exploded)Build

    这里写图片描述

  • casbuildlibsexplodedcas.warWEB-INFlibcas-server-webapp-5.0.3.1.war

    这里写图片描述

  • 复制粘贴到Tomcat下的webapp中并改名 cas.war

  • 运行 Tomcat

  • 浏览器访问http://127.0.0.1:8080/cas/login

    这里写图片描述

    输入系统默认用户名:casuser   密码:Mellon
    出现以下界面则成功

    这里写图片描述

3.启用Mongodb

  • casbuild.gradledependencies 里添加以下代码

    compile "org.apereo.cas:cas-server-support-mongo:${project.'cas.version'}"

    这里写图片描述

  • 右侧 GradleRefresh

    这里写图片描述

  • 然后 Build Artifact

  • lib 下除了cas-server-webapp-5.0.3.1.war 以外的所有 jar 包复制粘贴到 tomcat webappcas\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
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值