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

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

Introduction

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

Prototype

public CsrfConfigurer<HttpSecurity> csrf() throws Exception 

Source Link

Document

Adds CSRF support.

Usage

From source file:com.sg.rest.spring.SecurityContext.java

public static void ConfigureStatelessSecurityWithoutCsrfProtection(HttpSecurity http) throws Exception {
    //Stateless/* w ww.  j  a v  a 2 s.  c om*/
    http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
    //No csrf
    http.csrf().disable();
}

From source file:com.javiermoreno.springboot.mvc.users.CustomSecurityAdapter.java

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.csrf().disable().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
            .authorizeRequests().antMatchers("/**").permitAll();
}

From source file:com.counter.counter.api.SpringSecurityConfig.java

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.csrf().disable().authorizeRequests().anyRequest().authenticated().and().httpBasic()
            .authenticationEntryPoint(authEntryPoint);
}

From source file:com.phoenixnap.oss.sample.server.EnpointSecurity.java

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.csrf().disable();

}

From source file:com.handu.open.dubbo.monitor.config.Security.java

protected void configure(HttpSecurity http) throws Exception {
    http.csrf().disable().authorizeRequests().anyRequest().authenticated().and().httpBasic();
}

From source file:com.infinity.config.SecurityConfig.java

@Override
protected void configure(HttpSecurity http) throws Exception {

    http.csrf().disable().authorizeRequests().antMatchers("/**").access("hasRole('ROLE_USER')")

            .and().formLogin();/*from   w w  w  .j ava 2s  .  c o m*/

}

From source file:eauction.web.WebSecurityConfig.java

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.csrf().and().authorizeRequests().antMatchers("/assets/**").permitAll().anyRequest().authenticated()
            .and().formLogin().loginPage("/login.html").loginProcessingUrl("/login").permitAll().and().logout()
            .logoutSuccessUrl("/login.html?logout").logoutUrl("/logout.html").permitAll();
}

From source file:com.pegawai.app.SecurityConfig.java

protected void configure(HttpSecurity http) throws Exception {
    http.csrf().disable().authorizeRequests().antMatchers("/assets/**").permitAll().antMatchers("/jabatan/**")
            .hasAuthority("ADM").antMatchers("/pegawai/**").hasAuthority("OPR").anyRequest().authenticated()
            .and().logout().logoutUrl("/logout").logoutSuccessUrl("/login").and().formLogin()
            .loginPage("/login").defaultSuccessUrl("/index", true).permitAll();
}

From source file:at.ac.tuwien.infosys.configuration.SecurityConfiguration.java

@Override
protected void configure(final HttpSecurity http) throws Exception {
    http.csrf().disable().authorizeRequests().anyRequest().authenticated();
}

From source file:com.tamnd2.basicwebapp.security.SecurityConfig.java

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.csrf().disable().exceptionHandling().authenticationEntryPoint(unauthorizeHandler).and().formLogin()
            .successHandler(authSuccess).failureHandler(authFailure).and().authorizeRequests()
            .antMatchers("/**").permitAll();
}