CAS如何处理会话超时
我对CAS的理解:
有1个CAS服务器和2个CAS客户端,
client1通过CAS登录成功 用户在 client1 上工作,因此 client1 的会话由用户操作刷新。但CAS服务器会话超时。 用户尝试访问client2,检查CAS时发现会话超时,需要重新登录,但client1已经登录。
这没有道理,如果我错了,请纠正我。
My understanding about CAS:
Have 1 CAS server and 2 CAS client,
client1 login success through CAS
user works on client1, so client1's session is refreshed by user action. But CAS server session timeout.
user try access client2, when check CAS found the session is timeout, so need login again, but the client1 is already login.
It does not make sense, please correct me if i am wrong.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
CAS 使用“服务”来区分网站。在 cas 内,将有一个“client1”服务和一个“client2”服务,每个服务都有自己的 TicketGrantingTicket。会话超时通过此处描述的 TGT 的 CAS 服务器票证过期策略进行控制:
https: //wiki.jasig.org/display/CASUM/Ticket+Expiration+Policy
这样,每个服务器都会有自己的超时时间。因此,当我转到 client1 并单击链接时,这不会对 client2 的会话超时产生影响。
如果您希望这两个网站影响其超时,则需要让它们使用相同的服务并调查代理授予票证的使用:
https://wiki.jasig.org/display/CAS/Proxy+CAS+演练
CAS uses "services" to differentiate the websites. Within cas there would be a "client1" service and a "client2" service, each with their own TicketGrantingTicket. The session timeout is controlled through the CAS servers ticket expiration policy for TGT's described here:
https://wiki.jasig.org/display/CASUM/Ticket+Expiration+Policy
In this way, each of the servers would have their own timeout. So when I go to client1 and click a link, this would have no effect on the session timeout for client2.
If you wanted the two websites to affect their timeouts, you'll need to make them use the same service and investigate the use of Proxy Granting tickets:
https://wiki.jasig.org/display/CAS/Proxy+CAS+Walkthrough
Client1 可能仍处于登录状态的原因是,您没有处理 CAS 在用户的 TicketGrantingTicket 过期时发出的注销帖子。
当 CAS 中发生注销事件时,它会向所有已注册的服务发送注销帖子。 Client1 需要通过查看请求来处理此问题。如果您碰巧使用 PHP,则需要查看 $_REQUEST 以获得注销消息。
The reason Client1 might still be logged in is because you are not handling the logout post that CAS sends out when it expires a user's TicketGrantingTicket.
When a logout event happens in CAS it sends a logout post to all it's registered services. Client1 needs to handle this by looking at the request. If by chance you are using PHP you need to take a look at $_REQUEST for a logout message.