Get current user at controller level

Hi,

How can I get the current user in my controller? I can't find a relevant bean.

Thanks

<bb />

2 comments

Oh,

Session has USER_KEY

<bb />

0

Later is better then never...

context.getAuthorityHolder().getAssociatedUser()

where context is SecurityContext instance that you can get via Spring injection.

0

Please sign in to leave a comment.