We've seen how Spring Security makes it very easy to get started. Now let's see how we can customize the login experience. In the following code snippet, we demonstrate the usage of some of the more common ways to customize login, but we encourage you to refer to the reference documentation of Spring Security, which includes an Appendix, Additional Reference Material with all of the supported attributes.
Let's take a look at the following steps to customize login:
- First, update your SecurityConfig.java file as follows:
//src/main/java/com/packtpub/springsecurity/configuration/ SecurityConfig.java http.authorizeRequests() ... .formLogin() .loginPage("/login/form") .loginProcessingUrl("/login") .failureUrl("/login/form?error") ...