如果我们使用 app1 并且不使用其他应用程序,TGT 就会过期
我们对票证授予票证过期政策有疑问。我们使用的是cas认证。 TGT 在 2 小时后过期,而 java 会话在 30 分钟后过期。我们的问题是,如果用户仅使用 Web 应用程序超过两个小时,并且尝试使用另一个 Web 应用程序,则票证授予票证将过期,因此用户必须重新登录,尽管他可以在第一个 Web 应用程序中工作。
当用户在第一个 Web 应用程序中工作时,有没有办法更新票证授予票证?
we have a question about ticket-granting tickets expiration policy. We are using cas authentication. The TGT expires after 2 hours whereas java session exiperes after 30 minutes.Our problem is that if a user works only using a web application more than two hours and than tries to use another web application, the ticket-granting ticket is expired and so the user must re-login, although he can work in the first web application.
Is there a way to renew ticket-granting ticket while the user is working in the first web application??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
遗憾的是,从 CAS 3.4 开始(当我研究一个非常相似的问题时),没有做一些魔法,答案是否定的。
如果你绝对必须实现这个功能,我遇到的最好的想法(一个同事提出的,而不是我)是让你的应用程序的每个页面都使用 Javascript 来“ping”你的 CAS 服务器(一个简单的不关心返回的 AJAX 请求将起作用),并实现自定义 TGT 过期策略,该策略跟踪最后一次 ping 回,并在最后一次 ping 超过 X 秒前时使票证过期。然而,这种方法需要大量的 CAS 框架挂钩,我建议不要这样做。我本来想提供代码,但自从我真正深入研究 CAS 的内部结构以来已经太久了。
Sadly, short of doing some magic, as of CAS 3.4 (when I was looking into a very similar problem) the answer is no.
If you absolutely have to implement this feature, the best idea I've run across (a co-worker came up with it, not me) was to have every page of your apps use Javascript to "ping" your CAS server (a simple AJAX request that doesn't care about the return will work), and implement a custom TGT Expiration Policy that keeps track of the last ping-back and expires the ticket if the last ping was more than X seconds ago. However, this approach requires a considerable amount of hooks into the CAS framework and I would recommend against it. I'd provide code but it has been too long since I really dug into CAS's internals.