Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

RE: Getting the authenticated user from Spring Security for use in
an Action

Hoying, Ken

2010-03-17

Replies: Find Java Web Hosting

Author LoginPost Reply
Try:

SecurityContextHolder.getContext().getAuthentication().getPrincipal()

-----Original Message-----
From: Lance Hill [mailto:lance@(protected)]
Sent: Tuesday, March 16, 2010 5:15 PM
To: 'Struts Users Mailing List'
Subject: Getting the authenticated user from Spring Security for use in an Action

I need to access information about the currently logged in user. I don't
think putting the user into the session during login is how it is supposed
to be done, but I have not found examples of how to get access to the
current user from Spring/Spring Security. Can someone please provide a link
or brief example of the best practice?


Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

-----------------------------------------
***Note:The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify the Sender
immediately by replying to the message and deleting it from your
computer. Thank you. Premier Inc.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 gg3721.com - Jax Systems, LLC, U.S.A.