November 2017
Intermediate to advanced
542 pages
14h 24m
English
We have successfully eliminated the need to manage both Spring Security users and our CalendarUser objects. However, it is still cumbersome for us to continually need to translate between the two objects. Instead, we will create a CalendarUserDetails object, which can be referred to as both UserDetails and CalendarUser. Update CalendarUserDetailsService to use CalendarUserDetails, as follows:
//src/main/java/com/packtpub/springsecurity/core/userdetails/CalendarUserDetailsService.javapublic UserDetails loadUserByUsername(String username) throwsUsernameNotFoundException {...return new CalendarUserDetails(user);}private final class CalendarUserDetails extends CalendarUser implements UserDetails {CalendarUserDetails(CalendarUser ...Read now
Unlock full access