Re: [appfuse-user] getting current logged in user

2007-02-21 Thread Dale Newfield
sionsmith wrote: here is a simple example of what i have: user = userManager.getUserByUsername(getRequest().getRemoteUser()); I've found there are times when I need basic info from the current user object (which acegi stores in the session, so going to the DB is not necessary), and times whe

Re: [appfuse-user] getting current logged in user

2007-02-21 Thread sionsmith
here is a simple example of what i have: user = userManager.getUserByUsername(getRequest().getRemoteUser()); mraible wrote: > > Yes. > > On 2/21/07, tonyl <[EMAIL PROTECTED]> wrote: >> >> Thanks Matt for the quick response. >> >> Yeah, I just want to get the current logged-in username. So, I

Re: [appfuse-user] getting current logged in user

2007-02-20 Thread Matt Raible
Yes. On 2/21/07, tonyl <[EMAIL PROTECTED]> wrote: Thanks Matt for the quick response. Yeah, I just want to get the current logged-in username. So, I take it getRequest().getRemoteUser() returns the username for the principal? Tony mraible wrote: > > If all you need to retrieve is the userna

Re: [appfuse-user] getting current logged in user

2007-02-20 Thread tonyl
Thanks Matt for the quick response. Yeah, I just want to get the current logged-in username. So, I take it getRequest().getRemoteUser() returns the username for the principal? Tony mraible wrote: > > If all you need to retrieve is the username, > getRequest().getRemoteUser() should be suffici

Re: [appfuse-user] getting current logged in user

2007-02-20 Thread Matt Raible
If all you need to retrieve is the username, getRequest().getRemoteUser() should be sufficient. Matt On 2/21/07, tonyl <[EMAIL PROTECTED]> wrote: I need to get the current user and after searching forums and discussions and examples about how to do this, I found that variations on the followin

[appfuse-user] getting current logged in user

2007-02-20 Thread tonyl
I need to get the current user and after searching forums and discussions and examples about how to do this, I found that variations on the following code seem to be considered a good way to get the current user: SecurityContext ctx = null; Authentication auth = null; if( ctx =