日期:2014-05-17  浏览次数:20935 次

请教关于Yale CAS单点登陆的问题
最近项目中使用到了Yale Cas单点登陆系统,参照官方配置文档配置后可以进行单点登陆

但是碰到以下问题,请教各位前辈:

1、Cas Client采用纯web.xml形式配置,单点登陆没问题,登陆后刷新也没有问题,但是url栏中没有出现ticket参数【https://sso.venumeta.com:8443/venu/】,按照官方解释文档说,验证通过,跳转正常,url中会附加上ticket=xxx的参数,但是目前的测试使用中没有碰到什么异常问题

TicketValidator配置如下:
XML code

        <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>https://sso.venumeta.com:8443/cas</param-value>
        </init-param>
        <init-param>
            <param-name>serverName</param-name>
            <param-value>https://sso.venumeta.com:8443</param-value>
        </init-param>
    </filter>



2、Cas Client采用web.xml+Spring方式配置,单点登陆没问题,跳转没问题,url中ticket参数也正常【https://sso.venumeta.com:8443/venu/?ticket=ST-1-ncWS6TkNVKJac2Py6O1E-cas】,但是一刷新页面,就会出现错误,控制台信息如下:
Java code

2012-06-27 15:53:29,450 INFO [org.jasig.cas.CentralAuthenticationServiceImpl] - <ServiceTicket [ST-1-ncWS6TkNVKJac2Py6O1E-cas] does not exist.>
2012-06-27 15:53:29,450 INFO [com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: audit:unknown
WHAT: ST-1-ncWS6TkNVKJac2Py6O1E-cas
ACTION: SERVICE_TICKET_VALIDATE_FAILED
APPLICATION: CAS
WHEN: Wed Jun 27 15:53:29 CST 2012
CLIENT IP ADDRESS: 127.0.0.1
SERVER IP ADDRESS: 127.0.0.1
=============================================================

>
[WARN ][2012-06-27 15:53:29.605] org.jasig.cas.client.validation.AbstractTicketValidationFilter - org.jasig.cas.client.validation.TicketValidationException: 
        未能够识别出目标 'ST-1-ncWS6TkNVKJac2Py6O1E-cas'票根
    
org.jasig.cas.client.validation.TicketValidationException: 
        未能够识别出目标 'ST-1-ncWS6TkNVKJac2Py6O1E-cas'票根



TicketValidator配置如下:

web.xml:
XML code

    <filter>
        <filter-name>CAS Validation Filter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>  
            <param-name>targetBeanName</param-name>  
            <param-value>ticketValidationFilter</param-value>  
        </init-param>
    </filter>



Spring:
XML code

    <bean name="ticketValidationFilter" class="org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter" 
        p:serverName="${cas.client.appUrl}">
        <property name="ticketValidator">
            <bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator" p:encoding="UTF-8">
                <constructor-arg index="0" value="${cas.server.url}" />
            </bean>
        </property>
    </bean>



根据提示,是说ST票据不存在,但是这个为什么会不存在了呢?奇怪!

这个问题折腾小弟2天了,网上搜索各种资料,但是没发现解决办法,各位前辈大牛,有了解的请指导下小弟,感激不尽!

------解决方案--------------------
这个问题还是我说的意思,用过的ticket就不能再用了。具体的配置可以看server中的ticketExpirationPolicies.xml这个配