spring boot配置Cas单点登录

cas server配置:

个人总结网址:

http://blog.csdn.net/shunhua19881987/article/details/72724169

参照网址:http://www.jianshu.com/p/600593b1f366

源码github地址:https://github.com/willwu1984/springboot-cas-shiro

Cas server下载地址:

http://download.csdn.net/download/xiaohuzi1987/5262980

Cas Server源码地址(maven实现)地址:

https://github.com/ameizi/cas-server-webapp
 
 
Cas Server对应的maven依赖库地址:
http://mvnrepository.com/artifact/org.apereo.cas

Cas Server配置(按照cas Server数据源这个进行配置):

1)cas Server配置(http):

http://love.iteye.com/blog/2198440

修改数据库配置:deployerConfigContext.xml中的dataSource

如:


2)cas Server配置(https):

http://blog.csdn.net/dongdong_java/article/details/20069877

3)cas Server中数据源配置:

http://blog.csdn.net/mic_hero/article/details/50733977

4)cas Server默认登陆页面设置:

http://blog.csdn.net/wang379275614/article/details/46337789

注意:

cas client客户端iframesession超时获取丢失,导致iframe内部跳转至casServer的登陆地址,解决方法:

在casServer的登陆界面添加如下脚本:

<script type="text/javascript">

 //解决在iframe下因Session登陆超时问题,导致iframe页面嵌套登陆界面

        $(function (){

                if (window != top)

                          top.location.href =location.href;

        });

     </script>


 5)cas 客户端报错AuthenticationFailed: Bad credentials:

Cas代理报错error.authentication.credentials.bad

参照网址:http://blog.csdn.net/xiaoqingyun5/article/details/9265627

6)Cas 服务端返回更多的用户信息:

http://blog.csdn.net/shunhua19881987/article/details/72625737

7) CAS框架单点登录,自定义验证登录方式(添加系统标识字段)

参照网址:http://blog.csdn.net/lovesummerforever/article/details/38023385

实例:Spring boot配置单点登录客户端配置步骤

个人总结网址:

http://blog.csdn.net/shunhua19881987/article/details/72724109

1 pom.xml引入jar包:

<!-- cas client -->

   <dependency>

       <groupId>net.unicon.cas</groupId>

       <artifactId>cas-client-autoconfig-support</artifactId>

       <version>1.2.0-GA</version>     

</dependency>

2)在配置文件中配置cas client中的相关属性值:


3)在启动类中添加cas client注解:

@EnableCasClient//cas client客户端

4)修改login的登陆方法



5)修改login的登出方法


其中属性值的获取(就在loginCotroller.java中):

参照网址:

https://segmentfault.com/a/1190000007278169

注意:引入的jar包的版本号是1.2.0-GA
Cas client 参数说明:http://elim.iteye.com/blog/2142631

猜你喜欢

转载自blog.csdn.net/shunhua19881987/article/details/72724169