我应该在什么时候更改 Struts 获取会话令牌的方式?
看来我必须找到一种不同的方式来传输会话令牌 从 Flex 客户端到 Struts 后端,无需使用 cookie。
如果我要将会话令牌放入请求的有效负载中,那么我在什么时候必须自定义 Struts 的行为,以便可以尽可能多地重用现有的会话处理?特别是,我不想重新实现任何安全措施(例如将令牌绑定到 IP)和配置参数(例如会话过期间隔)。
有一个 CreateSession 拦截器,位于默认堆栈的早期,我应该将其与子类版本交换吗?
It seems I have to find a different way to transmit the session token from a Flex client to a Struts backend without using cookies.
If I were to put the session token in the payload of a request, at what point would I have to customize Struts' behaviour so that I can reuse as much of the existing session handling as possible? In particular, I don't want to reimplement whatever security measures (such as tying a token to an IP) and configuration parameters (such as session expiration interval).
There's a CreateSession interceptor, rather early in the default stack, should I swap that with a subclassed version?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我对 Flex 的经验不是很丰富,但因为这看起来很有趣,而且我不喜欢看到问题得不到解答,所以我想尝试一下。据我了解,Flex 会话(HttpFlexSession)和 HttpSession 是完全独立的实体。也就是说,您应该能够在它们之间共享数据。
有一个非常相关的免费章节(第 20 章:Flex 与 J2EE 集成< /a>)可从 Steven Webster 和 Alistair McLeod 所著的《使用 Macromedia Flex 开发富客户端》一书中获取。
我现在将大量引用该免费章节!特别值得注意的是:
本章稍后将向您展示如何配置 Flex 客户端访问的会话对象。
因此,虽然您可以在 Flex 和后端 Java 之间共享会话数据,但是,建议似乎是这是一种反模式。
关于安全措施,如果您使用 Servlet Filters 来实现 IP 限制,那么您的安全性可以应用于 Web 应用程序中的所有资源(无论它是 Struts 还是 Flex 来源)。
I'm not very experienced with Flex but as this seemed interesting and I do not like to see questions go unanswered I thought I would have a stab at it. As I understand it the Flex session (HttpFlexSession) and the HttpSession are completely separate entities. That said you should be able to share data between them.
There is a very relevant free chapter (Chapter 20: Flex Integration with J2EE) available from the book "Developing Rich Clients with Macromedia Flex" by Steven Webster and Alistair McLeod.
I will now quote heavily from that free chapter! Of particular note:
Later on in this chapter it shows you how to configure the session object for Flex client access.
So it would seem that although you can share session data between Flex and backend Java, however, the suggestion seems to be that this is an anti-pattern.
With respect to security measures, if you were using Servlet Filters to implement IP restriction then your security could be applied to all the resources in your web application (irrespective of whether it was of Struts or Flex origin).