Spring安全上下文路径解析器 [英] Spring security context path resolver

查看:94
本文介绍了Spring安全上下文路径解析器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想定义会话cookie的路径,这是从spring security设置的,以允许从web-app进行多次登录。例如:

I want to define the path of the session cookie, which is set from spring security, in order to allow multiple logins from the web-app. E.g:

http://localhost:8080/myApp/context1/login
http://localhost:8080/myApp/context2/login
http://localhost:8080/myApp/context3/login
...

基本上这可以通过覆盖 LoginUrlAuthenticationEntryPoint SimpleUrlAuthenticationFailureHandler SimpleUrlAuthenticationSuccessHandler SimpleUrlLogoutSuccessHandler 。然而,我找不到一个处理程序,它负责设置cookie上下文路径,我需要覆盖它:

Basically this is possible by overwriting LoginUrlAuthenticationEntryPoint, SimpleUrlAuthenticationFailureHandler, SimpleUrlAuthenticationSuccessHandler, SimpleUrlLogoutSuccessHandler. However I cannot find a handler, which is responsible for setting the cookie context-path, which I need to overwrite from:

/myApp

转换为相应的等价物:

to the apropriate equivalent:

/myApp/context1

这是必需的,为了允许并行登录到这些应用程序。

This is needed, in order to allow parallel logins to these Apps.

问:如何为tomcat动态更改会话cookie(HttpSession)的cookie路径?

Q: How to change the cookie's path for session cookie (HttpSession) dynamically for tomcat?

推荐答案

好的...这次我想我已经找到了你要找的东西。查看这个答案

Ok... this time I think I have found what you are looking for. Look at this answer

我认为你可以在grails中创建一个过滤器

I think you can do it in grails creating a filter

这篇关于Spring安全上下文路径解析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆