Announcement Announcement Module
Collapse
No announcement yet.
How can i get remoteUser without using Spring Acegi Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can i get remoteUser without using Spring Acegi

    We are migrating our project to Spring MVC from struts 2. In Struts 2 it was easy to get remote user by invoking principal.getRemoteUser().

    I have been reading examples of how you can get remoteUser in spring by using Authentication while having spring security filters filtering over the url. Is there a way i can bypass spring security and still get remote user?

    I tried using HttpServletRequest as a parameter but getting null

    @RequestMapping(
    method = RequestMethod.GET, value = "/client/{id}")
    public @ResponseBody String getClient(@PathVariable String id,
    HttpServletRequest req)
    {
    System.out.println("Printing host: " + req.getRemoteUser());
    ....
    }

    Appreciate any help!
Working...
X