Results 1 to 4 of 4

Thread: Security tag to get username

  1. #1
    Join Date
    Mar 2005
    Posts
    135

    Default 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. #2
    Join Date
    Jun 2007
    Location
    Minsk, Belarus
    Posts
    224

    Default

    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

  3. #3
    Join Date
    Mar 2005
    Posts
    135

    Default

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

    Other suggestions?

  4. #4
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

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

    http://static.springframework.org/sp...onTag.html#101
    Spring - by Pivotal
    twitter @tekul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •