CAS认证后恢复原来的POST请求?
我有 json-rpc 服务仅接受 http POST-req,并希望它使用 CAS SSO 身份验证。 当前的请求流程大致如下:
POST host/service/ -> 302 redirect
GET host/cas/login?service=https%3A%2F%2Fhost%2Fservice%2F -> 302 redirect
GET host/service/?ticket=ST-16-0rtrEQunbcbNdP16Eu07-cas -> 302 redirect
GET host/service/ -> 405 GET Method not supported
我想我们需要将最后一个 GET 转换为 POST 并保存原始的帖子正文参数。 有什么提示吗?在 spring-sec 链中添加裸 RequestCacheAwareFilter 没有帮助。
I have json-rpc service accepting http POST-req only and would like it to use CAS SSO auth.
The current request flow looks roughly like this:
POST host/service/ -> 302 redirect
GET host/cas/login?service=https%3A%2F%2Fhost%2Fservice%2F -> 302 redirect
GET host/service/?ticket=ST-16-0rtrEQunbcbNdP16Eu07-cas -> 302 redirect
GET host/service/ -> 405 GET Method not supported
I suppose we need to convert last GET into POST with the original post body params saved.
Any hints? Adding bare RequestCacheAwareFilter in the spring-sec chain did not help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来解决问题的唯一方法是避免帖子重定向。因此,您需要对同一 Web 应用程序中某个已知的接受 GET 的服务 URL 进行正常的 GET(当您在 POST 上检测到 405 代码时)以重定向到 CAS 或从 CAS 重定向,然后您就可以安全地使用 POST。
Looks like the only way to solve the problem is to avoid redirect on post. Thus, you need to make normal GET (when you detect 405 code on POST) to some known GET-accepting service url in the same webapp to redirect to/from CAS, then you can use POSTs safely.