通过 Flex 和 Rails3-AMF 使用设计会话
我有一个 Flex 前端和一个 Rails 3 后端,我想与其建立一个会话。在您访问嵌入了 Flex 前端的页面之前,系统会通过 Devise 提示您显示 html 登录页面。
我可以通过 html 页面正常登录,但无法使用 amf 请求访问 Flex 会话。
我在 Flex 中有 Rails 会话令牌,但无法正确地将它们传递到 Rails 中。我正在尝试通过“发送”服务调用传递 sessiontokin,例如
somethingService.new.send(session_id: '###', _csrf_token: '###' )
Rails 正在以哈希形式接收会话参数,
{0=>{"session_id"=>'###')}}
而不是像
{"session_id"=>'###')}.
欢迎任何有关如何解决此问题或利用 Flex/RubyAmf/Rails 会话的建议。
谢谢。
I have a Flex front end and a Rails 3 back-end that I would like to establish a session to. Before you can access the page embedded with the flex front-end, you are prompted with a html login page through Devise.
I am able to login fine through the html page but cannot get access to the session with Flex using amf requests.
I have the rails session token in flex but cannot pass them into rails correctly. I am attempting to pass the sessiontokin in through a "send" service call like
somethingService.new.send(session_id: '###', _csrf_token: '###' )
and rails is receiving the session param in a hash as like
{0=>{"session_id"=>'###')}}
instead of like
{"session_id"=>'###')}
.
Any suggestions on how to fix this issue or to utilize a session with Flex/RubyAmf/Rails are welcomed.
Thx.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经有一段时间没有做过任何集成 Flex 和 Flex 的事情了。 Rails,但我有一个模糊的记忆,参数是通过 {0 =>; params} 如果没有在配置中明确映射。 github 上的rails3-amf 自述文件使用以下示例:
config.rails3amf.map_params :controller => '用户控制器', :action => 'getUser', :params =>; [:session_id]
如果您还没有,也许在 :params 中显式定义 session_id 会产生影响?
It's been a while since I've done anything with integrating flex & rails, but I have a vague memory that the params come through as {0 => params} if not explicitly mapped in the configuration. The rails3-amf readme on github uses this example:
config.rails3amf.map_params :controller => 'UserController', :action => 'getUser', :params => [:session_id]
If your not already, perhaps explicitly defining the session_id in the :params would make the difference?