What's the proper way to programmatically log a web visitor in under a particular username in Spring and Spring Security 3.1? It seems the way I was doing it under 2.5 has changed a little. I'm sure there's a much better way of doing this now.
Basically, when I create a new user, I need to also log them in at the same time.
Create an Authentication
(usually a UsernamePasswordAuthenticationToken
) and then call
SecurityContextHolder.getContext().setAuthentication(authentication)