My application uses Spring Security, and my client requires:
- users to be able to automatically login after signup.
- an admin to login as any user without knowing their password.
So I need to figure out how to login as any user automatically without knowing their password.
How can this be accomplished using Spring Security?
To get this to work, I had to:
Configure a reference to the UserDetailsService (jdbcUserService)
Autowire my userDetailsManager in my controller:
In the same controller, authenticate my user like so:
Note that a good precursor to just using spring security for your app can be found here.