I have a page for user to type in username/password and choose user role. User may or may not exist at the moment but I have to custom code to register the user from controller by information from the page.
The question is, how can I put the user role into the Security context after register or validate the user so that spring framework can identify user role across the application, like in SecurityContextHolder?
Thanks.