title: Adding user to session, spring security default login
body: <p>I have set up spring security to intercept correctly and prompt user with custom login page, that then authenticates correctly and adds userdetails to SecurityContextHolder.</p>
  
  <p>Supplementary to that I now want to add my own custom User object added to session whenever login is performed; so the code will look like this:  </p>
  
  <pre><code>public returnwhat? doMySupplementaryLogin() {
  
     UserDetails principal = (UserDetails) SecurityContextHolder.getContext()
                                  .getAuthentication().getPrincipal();
     MyUser user = myUserService.getMyUser(principal.getUsername());
  
     add user to what ?
  }
  </code></pre>
  
  <p>Where will this code go? I want the nomral spring authentication to be performed and then the above code will put a MyUser object into session and then send user to the original intercepted url/viewname. I have the strong feeling I am making things more complicated than they need to be ...</p>