Reputation: 12416
I am unable to find how the java.security.Principal in HttpServletRequest is created - who is responsible? How it is done? Is it necessarily kept in Session?
How it is connected to Spring Security?
Are there any alternatives to Spring Security which uses Principal for User authorization/authentication?
How would one implement own user authorization/authentication so that Principal would contain the current user?
Upvotes: 4
Views: 7580
Reputation: 2273
Authentication
interface extends Principal
interface UserDetailsService
which wil return your User object(it must implement UserDetails interface) See docs.Upvotes: 5
Reputation: 2336
The Principal will be set by Spring Security based upon your Spring Security configuration.
To implement this, please see http://static.springsource.org/spring-security/site/docs/3.1.x/reference/springsecurity.html
Upvotes: -1