CAS服务票证验证失败

dan*_*iao 8 service ssl cas single-sign-on

我已经按照http://lukesampson.com/post/315838839/cas-on-windows-localhost-setup-in-5-mins链接,然后cas服务器正常工作,登录URL为http://10.1. 1.26:8080/login,验证URL为http://10.1.1.26:8080/serviceValidate.

然后我测试它如下:

  1. 致电http://10.1.1.26:8080/login?service=http://10.1.1.9:8081/default.aspx
  2. 我成功获得了服务票,例如ST-9-pJ5UDxqKIHP2zuN3JGe4-cas
  3. 然后我通过调用http://10.1.1.26:8080/serviceValidate?ticket=ST-9-pJ5UDxqKIHP2zuN3JGe4-cas&service=http://10.1.1.9:8081/default.aspx验证服务票证,
  4. 不幸的是,它总是返回无效的票,

为了解决它,我尝试cas 1.0验证网址,http://10.1.1.26:8080/ validate?ticket=ST-9-pJ5UDxqKIHP2zuN3JGe4-cas&service= http://10.1.1.9:8081/default.aspx,但是它返回"不".

然后我生成一个证书文件并将其放入密钥库,然后我使用https://10.1.1.26:8443尝试了上述所有步骤,但是,验证仍然失败.

我更改了cas log4j配置,打印所有调试信息,下面是日志

2012-02-21 13:18:36,371 DEBUG [org.springframework.web.servlet.DispatcherServlet
] - <DispatcherServlet with name 'cas' processing GET request for [/cas-server-w
ebapp-3.4.11/serviceValidate]>
2012-02-21 13:18:36,381 DEBUG [org.springframework.webflow.mvc.servlet.FlowHandl
erMapping] - <No flow mapping found for request with URI '/cas-server-webapp-3.4
.11/serviceValidate'>
2012-02-21 13:18:36,381 DEBUG [org.springframework.web.servlet.handler.SimpleUrl
HandlerMapping] - <Mapping [/serviceValidate] to HandlerExecutionChain with hand
ler [org.jasig.cas.web.ServiceValidateController@302a4b] and 1 interceptor>
2012-02-21 13:18:36,381 DEBUG [org.springframework.web.servlet.DispatcherServlet
] - <Last-Modified value for [/cas-server-webapp-3.4.11/serviceValidate] is: -1>
2012-02-21 13:18:36,391 INFO [org.jasig.cas.CentralAuthenticationServiceImpl] -
<ServiceTicket [ST-1-pqIeCRqcafGBE6idoCcd-cas] has expired.>
2012-02-21 13:18:36,391 INFO [com.github.inspektr.audit.support.Slf4jLoggingAudi
tTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: audit:unknown
WHAT: ST-1-pqIeCRqcafGBE6idoCcd-cas
ACTION: SERVICE_TICKET_VALIDATE_FAILED
APPLICATION: CAS
WHEN: Tue Feb 21 13:18:36 EST 2012
CLIENT IP ADDRESS: 10.1.1.9
SERVER IP ADDRESS: 10.1.1.26
=============================================================
Run Code Online (Sandbox Code Playgroud)

我不明白,不知道为什么从其他帖子我看到日志有类似"写票务登记处的服务票,并检索服务票",但在我的日志中没有任何关于

Hon*_*ons 19

我不是百分百肯定,因为我看不到你的配置,但日志说明了这一点

<ServiceTicket [ST-1-pqIeCRqcafGBE6idoCcd-cas] has expired.>
Run Code Online (Sandbox Code Playgroud)

这意味着故障单已经过期.CAS中存在一个配置文件,ticketExpirationPolicies.xml其中包含票证有效的次数.在我的CAS版本中,服务票证的有效期设置为10000毫秒.也许第1步和第3步之间的时间比文件中的到期时间设置(当然)可能与我的不同

<!-- Expiration policies -->
<bean id="serviceTicketExpirationPolicy" class="org.jasig.cas.ticket.support.MultiTimeUseOrTimeoutExpirationPolicy">
    <!-- This argument is the number of times that a ticket can be used before its considered expired. -->
    <constructor-arg
        index="0"
        value="1" />

    <!-- This argument is the time a ticket can exist before its considered expired.  -->
    <constructor-arg
        index="1"
        value="10000" />
</bean>

<bean id="grantingTicketExpirationPolicy" class="org.jasig.cas.ticket.support.TimeoutExpirationPolicy">
    <!-- This argument is the time a ticket can exist before its considered expired.  -->
    <constructor-arg
        index="0"
        value="7200000" />
</bean>
Run Code Online (Sandbox Code Playgroud)

我认为您遵循的教程在配置设置中并不完整.根据您尝试使用此CAS服务器实现的目标,您可能需要一些此处描述的自定义