Example usage for org.springframework.security.config.annotation.web.builders HttpSecurity logout

List of usage examples for org.springframework.security.config.annotation.web.builders HttpSecurity logout

Introduction

In this page you can find the example usage for org.springframework.security.config.annotation.web.builders HttpSecurity logout.

Prototype

public LogoutConfigurer<HttpSecurity> logout() throws Exception 

Source Link

Document

Provides logout support.

Usage

From source file:net.prasenjit.security.proxy.SecurityConfiguration.java

@Override
public void configure(HttpSecurity http) throws Exception {
    http.logout().and().antMatcher("/**").authorizeRequests().anyRequest().authenticated();
}

From source file:cn.designthougths.sample.axon.sfav.webui.UIApplication.java

@Override
public void configure(HttpSecurity http) throws Exception {
    http.logout().and().headers()
            .addHeaderWriter(//w  w  w .  java2s. c om
                    new XFrameOptionsHeaderWriter(XFrameOptionsHeaderWriter.XFrameOptionsMode.SAMEORIGIN))
            .and().antMatcher("/**").authorizeRequests()
            .antMatchers("/index.html", "/location.html", "/templates/*", "/partials/*", "/", "/login")
            .permitAll().anyRequest().authenticated().and().csrf().csrfTokenRepository(csrfTokenRepository())
            .and().addFilterAfter(csrfHeaderFilter(), CsrfFilter.class);
}

From source file:com.kazuki43zoo.jpetstore.config.WebSecurityConfig.java

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.formLogin().loginPage("/login").defaultSuccessUrl("/catalog").permitAll();
    http.logout().logoutRequestMatcher(new AntPathRequestMatcher("/logout")).logoutSuccessUrl("/catalog")
            .deleteCookies("JSESSIONID").permitAll();
    http.authorizeRequests().mvcMatchers("/my/**").authenticated().anyRequest().permitAll();
}

From source file:shiver.me.timbers.spring.security.JwtSpringSecurityAdaptor.java

@Override
public void init(HttpSecurity http) throws Exception {
    autowireThis(http);/*from  w  w  w  . ja  v a 2 s .c  o  m*/

    http.logout().addLogoutHandler(logoutHandler);
    fieldMutator.update(http.formLogin(), "authFilter", AbstractAuthenticationProcessingFilter.class,
            new UsernamePasswordAuthenticationFilterWrapper());
    http.addFilterBefore(authenticationFilter, UsernamePasswordAuthenticationFilter.class);
}

From source file:org.moserp.infrastructure.gateway.config.OAuthConfiguration.java

/**
 * Define the security that applies to the proxy
 *///from  w  w  w .j a v  a 2  s  . co m
public void configure(HttpSecurity http) throws Exception {
    http.logout().and().antMatcher("/**").authorizeRequests()
            .antMatchers("/index.html", "/home.html", "/web/**", "/uaa/oauth/**").permitAll().anyRequest()
            .authenticated().and().csrf().csrfTokenRepository(getCSRFTokenRepository())
            .ignoringAntMatchers("/uaa/oauth/token").and()
            .addFilterAfter(createCSRFHeaderFilter(), CsrfFilter.class);
}

From source file:cz.muni.pa165.carparkapp.configuration.MySecurityConfig.java

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.authorizeRequests().antMatchers("/road.jpg", "/style.css").permitAll();

    http.logout().logoutUrl("/logout").logoutSuccessUrl("/login?logout=true").permitAll();

    http.csrf().disable();// w  w  w  .ja v  a2 s .  com

    http.authorizeRequests().antMatchers("/admin/**").hasRole("ADMIN") // #6
            .anyRequest().authenticated().and().formLogin().loginPage("/login")
            .successHandler(new AuthenticationHandler()).failureUrl("/login?auth=fail").permitAll();

    http.exceptionHandling().accessDeniedPage("/403");
}

From source file:shiver.me.timbers.security.web.advanced.SecurityConfiguration.java

@Override
protected void configureFurther(HttpSecurity http) throws Exception {
    http.authorizeRequests().anyRequest().authenticated();
    http.formLogin().loginPage("/spring/signIn").permitAll();
    http.logout().logoutUrl("/spring/signOut").logoutSuccessUrl("/spring/");
}

From source file:com.boaglio.config.SecureConfig.java

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.authorizeRequests().anyRequest().fullyAuthenticated().and().formLogin().loginPage("/login")
            .failureUrl("/login?error").permitAll().and().logout().permitAll();

    //logout configuration
    http.logout().logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler);
}

From source file:de.pksoftware.springstrap.core.config.WebSecurityConfigBase.java

protected void configureLogout(HttpSecurity http) throws Exception {
    // Define logout URL
    // TODO Cookie Name!
    http.logout().logoutUrl(SpringstrapConfiguration.DEFAULT_LOGIN_SIGNOUT_PAGE)
            .deleteCookies(SpringstrapConfiguration.DEFAULT_LOGIN_COOKIE_NAME);
}

From source file:com.restfiddle.config.security.SecurityConfig.java

protected void configure(HttpSecurity http) throws Exception {
    http.csrf().disable();/*from   ww w  .j ava  2 s.c o m*/
    http.authorizeRequests().antMatchers("/api/**", "/about", "/fonts/**").permitAll().anyRequest()
            .authenticated().and().formLogin().loginPage("/login").failureUrl("/login?error").permitAll();
    http.logout().logoutSuccessUrl("/");
}