【发布时间】:2014-11-04 12:06:31
【问题描述】:
使用 Spring Security 3.2.5 和 Spring 4.0.6。 Spring Security 配置为使用 http 标头进行预身份验证。
Spring Security 可以正确抓取头部、查找用户并从数据库中获取身份验证角色。
问题是当用户注销并以新用户身份登录时,spring security没有检测到更改的header,仍然返回之前登录的用户。
1 - 通过外部应用程序 (siteminder) 以用户#1 身份登录
2 - spring security 正确报告用户#1 已登录
3 - 在应用程序之外,退出站点管理器
4 - 通过站点管理员以用户#2 身份登录
5 - 在 web 应用程序中,当 siteminder 为用户#2 提供标头信息时,spring security 现在会错误地报告用户#1 登录
在 spring-security.xml 中,我尝试为 spring security 添加一个指令以不缓存用户,但它在应用程序中出现异常。
<security:http create-session="stateless" />
ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Wed Sep 10 11:57:10 MDT 2014]; root of context hierarchy
Configuration problem: No AuthenticationEntryPoint could be established. Please make sure you have a login mechanism configured through the namespace (such as form-login) or specify a custom AuthenticationEntryPoint with the 'entry-point-ref' attribute
如何配置spring security在pre-authentication header改变时重新授权?
谢谢!
【问题讨论】:
标签: java spring spring-security