Announcement Announcement Module
Collapse
No announcement yet.
Security tag to get username Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Security tag to get username

    How can I use the Spring 2.0 security tag to get the user information?

    In acegi security, we used:
    Code:
    <authz:authentication operation="id"/>
    But that doesn't work anymore.
    I've already tried to use following
    Code:
    <security:authentication property="principal.id"/>
    <security:authentication property="id"/>
    without success... can somebody point me in the right direction?

  • #2
    For me the following works:

    Code:
    <%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
    
    <security:authentication property="principal.username" />
    <br/>
    <security:authentication property="principal.id" />
    Look also at sample tutorial:
    samples\tutorial\src\main\webapp\secure\index.jsp

    Comment


    • #3
      Nope, that doesn't work for me... can't find property exception.

      Other suggestions?

      Comment


      • #4
        The valid properties will depend on what's stored in your Authentication object:

        http://static.springframework.org/sp...onTag.html#101

        Comment

        Working...
        X