A common requirement is to allow users to create a new account and then automatically log them in to the application. In this section, we'll describe the simplest method for indicating that a user is authenticated, by utilizing SecurityContextHolder.
Logging in new users using SecurityContextHolder
Managing users in Spring Security
The application provided in Chapter 1, Anatomy of an Unsafe Application, provides a mechanism for creating a new CalendarUser object, so it should be fairly trivial to create our CalendarUser object after a user signs up. However, Spring Security has no knowledge of CalendarUser. This means that we will need to add a new user in Spring Security too. Don't worry, we will remove the need...