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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.