- Common ways to obtain HttpSecurityBuilder
private void myMethod () {HttpSecurityBuilder h =
HttpSecurity http;http.csrf().disable()
HttpSecurity httpSecurity;httpSecurity.httpBasic().disable()
HttpSecurity httpSecurity;httpSecurity.authorizeRequests().anyRequest().authenticated().and().csrf().disable()
- Smart code suggestions by Codota
}
@Override public void configure(H http) throws Exception { AuthenticationTokenFilter af = getAuthenticationFilter(); if(authenticationDetailsSource != null) { af.setAuthenticationDetailsSource(authenticationDetailsSource); } af.setAuthenticationManager(http.getSharedObject(AuthenticationManager.class)); af.setAuthenticationSuccessHandler(new AuthenticationStubSuccessHandler()); SessionAuthenticationStrategy sessionAuthenticationStrategy = http.getSharedObject(SessionAuthenticationStrategy.class); if(sessionAuthenticationStrategy != null) { af.setSessionAuthenticationStrategy(sessionAuthenticationStrategy); } AuthenticationTokenFilter filter = postProcess(af); filter.setContinueChainAfterSuccessfulAuthentication(true); http.addFilterBefore(filter, BasicAuthenticationFilter.class); }