O'Reilly logo

Spring Security - Third Edition by Peter Mularien, Robert Winch, Mick Knutson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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") ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required