@Override public H disable() { getBuilder().setSharedObject(RequestCache.class, new NullRequestCache()); return super.disable(); }
if (requestCache == null) { if (stateless) { http.setSharedObject(RequestCache.class, new NullRequestCache());
@Override public H disable() { getBuilder().setSharedObject(RequestCache.class, new NullRequestCache()); return super.disable(); }
@Configuration @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.requestCache() .requestCache(new NullRequestCache()); } }
public HttpSecurity configureHttp(HttpSecurity http, IntranetSecurityAccessDeniedHandler intranetSecurityAccessDeniedHandler) throws Exception { http .requestCache().requestCache(new NullRequestCache()).and()}
@Override protected void configure(HttpSecurity http) throws Exception { http .csrf().disable() .authorizeRequests() .antMatchers("/user/login, /user/signup, /logout").permitAll() .antMatchers("/user/**").hasRole("ADMIN") .and() .requestCache() .requestCache(new NullRequestCache()) .and() .httpBasic();
@Bean public RequestCache requestCache() { return new NullRequestCache(); }
if (requestCache == null) { if (stateless) { http.setSharedObject(RequestCache.class, new NullRequestCache());
@EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { // @formatter:off @Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .anyRequest().authenticated() .and() .requestCache() .requestCache(new NullRequestCache()) .and() .httpBasic(); } // @formatter:on // @formatter:off @Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { auth .inMemoryAuthentication() .withUser("user").password("password").roles("USER"); } // @formatter:on }
@Override public H disable() { getBuilder().setSharedObject(RequestCache.class, new NullRequestCache()); return super.disable(); }
@Override protected void configure(HttpSecurity http) throws Exception { http.securityContext().securityContextRepository(securityContextRepository); http.requestCache().requestCache(new NullRequestCache()); http .authorizeRequests() .antMatchers("/", "/home", "/categories/**", "/products/**").permitAll() .antMatchers("/admin/**").hasRole("ADMIN") .anyRequest().authenticated() .and() .formLogin() // login .loginPage("/login") .permitAll() .successHandler(new CustomAuthSuccessHandler()) .and() .logout() // /login?logout .logoutUrl("/logout") .logoutSuccessUrl("/loggedOut") .deleteCookies(SecurityConfig.AUTHCOOKIENAME) .permitAll() .and() .csrf().disable() ; }
@Configuration @EnableWebSecurity public class CASWebSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { //disable HTTP Session management http .securityContext() .securityContextRepository(new NullSecurityContextRepository()) .and() .sessionManagement().disable(); http.requestCache().requestCache(new NullRequestCache()); //no security checks for health checks http.authorizeRequests().antMatchers("/health/**").permitAll(); http.csrf().disable(); http .exceptionHandling() .authenticationEntryPoint(authenticationEntryPoint()); http // login configuration .addFilter(authenticationFilter()) .authorizeRequests().anyRequest().authenticated(); } }
public AuthenticationSuccessHandler stormpathAuthenticationSuccessHandler() { StormpathLoginSuccessHandler loginSuccessHandler; if (oktaEnabled) { loginSuccessHandler = new OktaLoginSuccessHandler(client, authenticationResultSaver, produces); } else { loginSuccessHandler = new StormpathLoginSuccessHandler(client, authenticationResultSaver, produces); } loginSuccessHandler.setDefaultTargetUrl(loginNextUri); loginSuccessHandler.setTargetUrlParameter("next"); loginSuccessHandler.setRequestCache(new NullRequestCache()); return loginSuccessHandler; }
public AuthenticationSuccessHandler stormpathAuthenticationSuccessHandler() { StormpathLoginSuccessHandler loginSuccessHandler; if (oktaEnabled) { loginSuccessHandler = new OktaLoginSuccessHandler(client, authenticationResultSaver, produces); } else { loginSuccessHandler = new StormpathLoginSuccessHandler(client, authenticationResultSaver, produces); } loginSuccessHandler.setDefaultTargetUrl(loginNextUri); loginSuccessHandler.setTargetUrlParameter("next"); loginSuccessHandler.setRequestCache(new NullRequestCache()); return loginSuccessHandler; }
.requestCache().requestCache(new NullRequestCache()) .and() .csrf().disable();
@Override public void init(H builder) throws Exception { SecurityContextRepository securityContextRepository = builder.getSharedObject(SecurityContextRepository.class); boolean stateless = isStateless(); if(securityContextRepository == null) { if(stateless) { builder.setSharedObject(SecurityContextRepository.class, new NullSecurityContextRepository()); } else { HttpSessionSecurityContextRepository httpSecurityRepository = new HttpSessionSecurityContextRepository(); httpSecurityRepository.setDisableUrlRewriting(!enableSessionUrlRewriting); httpSecurityRepository.setAllowSessionCreation(isAllowSessionCreation()); builder.setSharedObject(SecurityContextRepository.class, httpSecurityRepository); } } RequestCache requestCache = builder.getSharedObject(RequestCache.class); if(requestCache == null) { if(stateless) { builder.setSharedObject(RequestCache.class, new NullRequestCache()); } } builder.setSharedObject(SessionAuthenticationStrategy.class, getSessionAuthenticationStrategy()); }
if (requestCache == null) { if (stateless) { http.setSharedObject(RequestCache.class, new NullRequestCache());