我已点击链接http://lukesampson.com/post/315838839/cas-on-windows-localhost-setup-in-5-mins,则cas服务器工作正常,登录url为http://10.1.1.26:8080/登录,验证网址为http://10.1.1.26:8080/serviceValidate.
然后我测试了如下:
- call http://10.1.1.26:8080/login?service=http://10.1.1.9:8081/default.aspx
- 我成功获取服务票据,例如ST-9-pJ5UDxqKIHP2zuN3JGe4-cas
- 然后我通过调用验证服务票证,
- 不幸的是,它总是返回无效的票,
为了修复它,我尝试 cas 1.0 验证 url,,但它返回“否”。
然后我生成一个证书文件并将其放入密钥库中,然后我使用以下命令尝试了上述所有步骤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
=============================================================
我不明白也不知道为什么是从其他帖子我看到日志有类似“将服务票证写入票证注册表,并检索服务票证”之类的内容,但我的日志中没有任何内容
我不是 100% 确定,因为我看不到你的配置,但日志是这样说的
<ServiceTicket [ST-1-pqIeCRqcafGBE6idoCcd-cas] has expired.>
这意味着票已经过期了。 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>
我认为您遵循的教程的配置设置并不完整。根据您尝试使用此 CAS 服务器实现的目标,您可能需要一些所描述的自定义here
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)