@Override protected void configure(HttpSecurity http) throws Exception { http .formLogin().and() .requestCache() .requestCache(this.requestCache); } }
@Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .anyRequest().authenticated() .and() .requestCache() .requestCache(requestCache) .and() .oauth2Client() .authorizationCodeGrant() .authorizationRequestResolver(authorizationRequestResolver) .accessTokenResponseClient(accessTokenResponseClient); }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .requestCache() .requestCache(requestCache) .and() .requestCache(); // @formatter:on } }
@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() ; }
.requestCache().requestCache(new NullRequestCache()) .and() .csrf().disable();
http.exceptionHandling().authenticationEntryPoint(new SimpleAuthenticationEntryPoint(confMap.get("security.signin"))); http.exceptionHandling().accessDeniedHandler(new SimpleAccessDeniedHandler(confMap.get("security.access_denied"))); http.requestCache().requestCache(new SimpleRequestCache()); http.logout().logoutUrl(confMap.get("security.signout")). logoutSuccessUrl(confMap.get("security.signout_success"));
http.exceptionHandling().authenticationEntryPoint(new SimpleAuthenticationEntryPoint(signinPath)); http.exceptionHandling().accessDeniedHandler(new SimpleAccessDeniedHandler(accessDeniedPath)); http.requestCache().requestCache(new SimpleRequestCache()); http.logout().logoutUrl(signoutPath).logoutSuccessUrl(signoutSuccessPath); http.rememberMe().rememberMeServices(rememberMeServices);
http.exceptionHandling().authenticationEntryPoint(new SimpleAuthenticationEntryPoint(signinPath)); http.exceptionHandling().accessDeniedHandler(new SimpleAccessDeniedHandler(accessDeniedPath)); http.requestCache().requestCache(new SimpleRequestCache()); http.logout().logoutUrl(signoutPath).logoutSuccessUrl(signoutSuccessPath); http.rememberMe().rememberMeServices(rememberMeServices);