Announcement Announcement Module
No announcement yet.
SecurityContext not being populated with principal user Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • SecurityContext not being populated with principal user

    I've got a spring MVC app that uses spring security and most of the time calling:

    Will give me back the currently logged in user. However, I have come across some cases where the Authentication object is null and the only way I can access the logged in user is by going through the session like so:

    This is kind of a hacky way of doing it and I wanted to know if anyone can tell me why the securityContext doesn't get populated in certain cases? The only controller that currently doesn't work is my AjaxController which handles any ajax calls from the jsp pages and mostly returns json to jquery ajax calls. Thanks for any help.

  • #2
    Have you checked the FAQ?