1、客户端启动报错,报错信息如下:

严重: Exception starting filter CAS Single Sign Out Filter
java.lang.IllegalArgumentException: casServerUrlPrefix cannot be null.
at org.jasig.cas.client.util.CommonUtils.assertNotNull(CommonUtils.java:80)
at org.jasig.cas.client.session.SingleSignOutHandler.init(SingleSignOutHandler.java:142)
at org.jasig.cas.client.session.SingleSignOutFilter.init(SingleSignOutFilter.java:58)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4830)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5510)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

  再确定web.xml文件casServerUrlPrefix配置无误之后,很可能的原因是cas client core版本不对。

  2、如发现cas client配置都没问题后,发现客户端A与客户端B之间的跳转需要再登录,很可能问题存在于ticketGrantingTicketCookieGenerator.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Licensed to Jasig under one or more contributor license
agreements. See the NOTICE file distributed with this work
for additional information regarding copyright ownership.
Jasig licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a
copy of the License at the following location: http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License. -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<description>
Defines the cookie that stores the TicketGrantingTicket. You most likely should never modify these (especially the "secure" property).
You can change the name if you want to make it harder for people to guess.
</description>
<bean id="ticketGrantingTicketCookieGenerator" class="org.jasig.cas.web.support.CookieRetrievingCookieGenerator"
p:cookieSecure="false"
p:cookieMaxAge="-1"
p:cookieName="CASTGC"
p:cookiePath="/cas" />
</beans>

  p:cookieSecure默认为true,不妨改为fasle试一试。

  3、当在cas server登录成功后,准备往客户端跳转,突然发现浏览器空白,且浏览器输入地址栏出现类似http://localhost:8008/j1-center/?ticket=ST-1-51PDs4kgv5XpOW7Vab91-cas01.example.org路径的时候,很有可能是标红的路径配置错误。

<filter>
<filter-name>CASFilter</filter-name>
<filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
<filter-class>com.founder.ec.sso.filter.CASFilter</filter-class>
<init-param>
<param-name>casServerLoginUrl</param-name>
<param-value>http://localhost:8082/cas/login</param-value>
</init-param>
<init-param>
<param-name>serverName</param-name>
<param-value>http://localhost:8008/</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CASFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> <filter>
<filter-name>CAS Validation Filter</filter-name>
<filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
<init-param>
<param-name>casServerUrlPrefix</param-name>
<param-value>http://localhost:8082/cas/</param-value>
</init-param>
<init-param>
<param-name>serverName</param-name>
<param-value>http://localhost:8008/</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CAS Validation Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

  4、当客户端页面出现:org.jasig.cas.client.validation.TicketValidationException: No principal was found in the response from the CAS server.页面报500的时候,很有可能出现的原因还是在cas client web.xml中cas server路径配置错误,如问题3。

  

  

  

CAS实战の遇到的问题的更多相关文章

  1. CAS实战の简介

    一.SSO简介 单点登录的英文名称为Single Sign-On,简写为SSO,它是一个用户认证的过程,允许用户一次性进行认证之后,就访问系统中不同的应用:而不需要访问每个应用时,都重新输入密码.IB ...

  2. CAS实战のclient自定义过滤器

    我们在配置cas client肯定写过如下代码: <filter> <filter-name>CASFilter</filter-name> <filter- ...

  3. CAS实战の获取多用户信息

    先列出版本号: 服务端版本:cas server 4.0.0 客户端版本:cas client 3.3.3 cas server step1:先将primaryPrincipalResolver be ...

  4. CAS实战の自定义注销

    步骤一 在cas server端,设置/WebContent/WEB-INF/cas-servlet.xml: <bean id="logoutAction" class=& ...

  5. CAS实战の自定义登录

    由于每个版本的改动较大,所以先把版本号列出: 服务端版本:cas server 4.0.0 客户端版本:cas client 3.3.3 一.自定义登录页面 页面路径:/WebContent/WEB- ...

  6. CAS机制详解

    目录 1. 定义 2. 实现原理 3. 无版本号CAS实战说明 4. CAS机制在Java中的应用 5. CAS的缺点 1. CPU开销过大 2. 不能保证代码块的原子性 3. ABA问题 6. JA ...

  7. 单点登录(七)-----实战-----cas server去掉https验证

    我们在搭建cas中已经说过如果不搭建https证书体系的需要去掉https的验证: 单点登录(二)----实战------简单搭建CAS---测试认证方式搭建CAS 因为cas4.2以上的代码做了一些 ...

  8. 单点登录(二)----实战------简单搭建CAS---测试认证方式搭建CAS

    我们在上一篇文章中已经介绍了cas以及它的工作流程. 单点登录(一)-----理论-----单点登录SSO的介绍和CAS+选型 本章我们开始动手搭建一个完整的cas服务实现2个web之间的单点登录. ...

  9. 基于CAS的单点登录实战(2)-- 搭建cas的php客户端

    在这之前已经搭好了CAS服务端 基于CAS的单点登录实战(1)-- 搭建cas服务器 PHP-Client php-Client是官方支持的,去官网下个最新版就好了.phpCAS 接入很简单,解压放到 ...

随机推荐

  1. Promise/Deferred

    [fydisk] 1.$.get('/api').success(onSuccess).error(onError).comlete(onComplete); 2.对同一事件加入多个Handler. ...

  2. Web标准:三、二列和三列布局

    知识点: 1.二列自适应宽度 2.二列固定宽度 3.二列固定宽度居中 4.xhtml的块级元素(div)和内联元素(span) 5.float属性 6.三列自适应宽度 7.三列固定宽度 8.三列固定宽 ...

  3. HibernateTemplate实现CRUD操作

    ---------------------siwuxie095 HibernateTemplate 实现 CRUD 操作 1.在 SSH 框架中使用 HibernateTemplate 模板类实现 C ...

  4. Repeater嵌套Repeater

    <asp:Repeater ID="rptXiaoLei" runat="server" OnItemDataBound="rptXiaoLei ...

  5. 仿微信客户端 帧布局中加入fragment

    学习内容来自“慕课网” 这里用Fragment来实现APP主界面 思路: 底部横向排列4个LinearLayout,每个LinearLayout包含一个图片按钮和一个文字 1.默认显示第一个功能(微信 ...

  6. springmvc使用包装的pojo接收商品信息的查询条件

    1.包装对象定义如下: 定义Items对象,并对其定义set和get方法. public class QueryVo { private Items items; public Items getIt ...

  7. 【深度好文】多线程之WaitHandle-->派生-》Semaphore信号量构造

    Semaphore 继承自WaitHandle. 信号量说简单点就是为了线程同步,或者说是为了限制线程能运行的数量. //创建一个限制资源类 //资源数为5,开放资源数为2 //主线程自动占有3个资源 ...

  8. Nginx 分析access日志文件

    Nginx Access Log日志统计分析常用命令 IP相关统计 统计IP访问量 awk '{print $1}' access.log | sort -n | uniq | wc -l 查看某一时 ...

  9. 转载 springboot 配置读取

    前言:了解过spring-Boot这个技术的,应该知道Spring-Boot的核心配置文件application.properties,当然也可以通过注解自定义配置文件**.properties的信息 ...

  10. myschool 相思树

    题目描述 一群妖王排成一排站在苦情巨树下,寻找自己的转世恋人.虽然都是妖王,但按照涂山的规定必须进行标号,标号为1的妖王排在最后面,标号为n的妖王排在最前面.每个妖王只有一个妖力值a[i]表示它们现在 ...