Announcement Announcement Module
Collapse
No announcement yet.
Acegi - UserProfile Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Acegi - UserProfile

    I am new to acegi. I am able to authenticate successfully. After login, I have to display the user information in the page header. I set these information in the AuthUser object in the dao authentication.

    Ex:
    authUser = new AuthUser(dbUser.getLoginId(), dbUser.getPassword(),
    true, ga,
    createUserProfile(dbUser));

    How can I access the AuthUser object created during authentication in my JSP ? Please help.

    Thanks,
    Aruna

  • #2
    Acegi creates the Authentication object during the authentication process. You can get it from the SecurityContextHolder - a ThreadLocal class, as follows;
    Code:
    Authentication auth = SecurityContextHolder.getContext().getAuthentication();
    Alternatively, if all you want is the username, then you can use the authentication tag

    Code:
    <authz&#58;authentication operation="principal"/>

    Comment

    Working...
    X