zoukankan      html  css  js  c++  java
  • 单点登录 CAS 客户端搭建与服务注册 -2

    服务端已经搭建完毕,现在搭建一个客户端,并测试一下单点登录。

    使用springboot搭建一个客户端服务

     

     增加web运行,和cas client jar包

      <!--boot web支持-->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
            </dependency>
            <!--cas client支持-->
            <dependency>
                <groupId>net.unicon.cas</groupId>
                <artifactId>cas-client-autoconfig-support</artifactId>
                <version>1.7.0-GA</version>
            </dependency>
    

      编辑登录成功后跳转的页面

     配置cas客户端

    增加cas客户端启动注解@EnableCasClient,并启动服务

    运行服务端地址singin   客户端 地址访问 http://localhost:8081/login  

    为了方便后续对于配置文件的修改,复制一份 application.properties

    由于cas是以http链接为基础的,所以需要修改cas server  以支持http链接, 在箭头处增加http

    1、增加http

     2、在 application.properties 文件增加两行

    cas.tgc.secure=false
    cas.serviceRegistry.initFromJson=true
    

      然后,再次访问客户端 输入账号密码

    登录成功

  • 相关阅读:
    H5 WebSocket
    JS call()、apply()、bind()
    JS中this指向问题
    JS GET POST请求
    php 常用get post http请求
    php 开启redis
    egret接入华为快应用6004
    PHP生成公私钥,签名和验签
    JS数组去重
    Oracle第九课
  • 原文地址:https://www.cnblogs.com/lewskay/p/10266826.html
Copyright © 2011-2022 走看看