November 2017
Intermediate to advanced
542 pages
14h 24m
English
Like most applications, our application requires us to interact with the currently logged-in user. We have created a very simple interface called UserContext to manage the currently logged-in user as follows:
//src/main/java/com/packtpub/springsecurity/service/UserContext.java public interface UserContext { CalendarUser getCurrentUser(); void setCurrentUser(CalendarUser user); }
This means that our application can call UserContext.getCurrentUser() to obtain the details of the currently logged-in user. It can also call UserContext.setCurrentUser(CalendarUser) to specify which user is logged in. Later in this chapter, we will explore how we can write an implementation of this interface that uses Spring Security to ...
Read now
Unlock full access