Extend from WebMvcConfigurerAdapter instead so that @AuthenticationPrincipal will work.
Showing how to use @AuthenticationPrincipal