【问题标题】:Spring security to recover the user name after interceptSpring Security拦截后恢复用户名
【发布时间】:2014-11-24 08:04:08
【问题描述】:

我有一个登录表单,它发布到一个被 acegi-security 拦截的 URL,但我想在服务器上的某个位置访问用户名。有什么我可以做的吗?

编辑

使用 acegi-security-1.0.3

谢谢

【问题讨论】:

  • 您使用的是什么版本的 Spring (acegi) Security?
  • @BirgitMartinelle 编辑了问题

标签: security jakarta-ee post spring-security


【解决方案1】:

看这里:http://java-x.blogspot.com/2006/12/spring-security-with-acegi-security.html 您应该能够通过获取身份验证从 SecurityContextHolder 上下文中获取用户名。

 <%= SecurityContextHolder.getContext().getAuthentication().getName() %> 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-11
    • 2015-07-25
    • 2012-08-15
    • 2014-06-17
    • 2013-03-17
    • 2013-06-04
    相关资源
    最近更新 更多