Updating our configuration

Now that we have created all the code required for an additional parameter, we need to configure Spring Security to be aware of it. The following code snippet includes the required updates to our SecurityConfig.java file to support our additional parameter:

//src/main/java/com/packtpub/springsecurity/configuration/SecurityConfig.java@Overrideprotected void configure(final HttpSecurity http) throws Exception {   http.authorizeRequests()       ...       .and().exceptionHandling()           .accessDeniedPage("/errors/403")           .authenticationEntryPoint(               loginUrlAuthenticationEntryPoint())       .and().formLogin()           .loginPage("/login/form")           .loginProcessingUrl("/login")           .failureUrl("/login/form?error")           .usernameParameter("username") .passwordParameter("password") ...

Get Spring Security - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.