当前位置: 首页>>代码示例>>Java>>正文


Java HttpSessionCsrfTokenRepository类代码示例

本文整理汇总了Java中org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository的典型用法代码示例。如果您正苦于以下问题:Java HttpSessionCsrfTokenRepository类的具体用法?Java HttpSessionCsrfTokenRepository怎么用?Java HttpSessionCsrfTokenRepository使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HttpSessionCsrfTokenRepository类属于org.springframework.security.web.csrf包,在下文中一共展示了HttpSessionCsrfTokenRepository类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: csrfTokenRepository

import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository; //导入依赖的package包/类
@Bean
public CsrfTokenRepository csrfTokenRepository() {
    HttpSessionCsrfTokenRepository repository =
            new HttpSessionCsrfTokenRepository();

    repository.setHeaderName("X-XSRF-TOKEN");
    return repository;
}
 
开发者ID:ortolanph,项目名称:hojeehdiaderua,代码行数:9,代码来源:SecurityConfig.java

示例2: configure

import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository; //导入依赖的package包/类
@Override
protected void configure(HttpSecurity http) throws Exception {
	http.antMatcher("/**")
		.authorizeRequests()
			.antMatchers("/", "/health", "/login**", "/webjars/**").permitAll()
			.anyRequest().authenticated()
		.and().logout().logoutSuccessUrl("/").permitAll()
		.and().csrf().csrfTokenRepository(new HttpSessionCsrfTokenRepository());
}
 
开发者ID:nicodewet,项目名称:template-spring-boot-oauth2-wso2-is,代码行数:10,代码来源:App.java

示例3: csrfTokenRepository

import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository; //导入依赖的package包/类
/**
 * define csrf header entry.
 *
 * @return csrf header entry
 */
@Bean
public CsrfTokenRepository csrfTokenRepository() {
  final HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
  repository.setHeaderName(ResourcePaths.XSRF_HEADER);
  return repository;
}
 
开发者ID:ManfredTremmel,项目名称:gwt-bean-validators-example,代码行数:12,代码来源:WebSecurityConfig.java

示例4: configure

import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository; //导入依赖的package包/类
@Override
protected void configure(HttpSecurity http) throws Exception {
    log.info("configuring security with USSD gateway: {}", environment.getProperty("grassroot.ussd.gateway", "127.0.0.1"));
    http
            .authorizeRequests()
                .antMatchers("/index").permitAll()
                .antMatchers("/signup").permitAll()
                .antMatchers("/signup/extra").permitAll()
                .antMatchers("/user/recovery").permitAll()
                .antMatchers("/user/recovery/success").permitAll()
                .antMatchers("/grass-root-verification/*").permitAll()
                .antMatchers("/livewire/public/**").permitAll()
                .antMatchers("/cardauth/**").permitAll()
                .antMatchers("/donate/**").permitAll()
                .antMatchers("/ussd/**").access(assembleUssdGatewayAccessString())
                .anyRequest().authenticated()
                .and()
            .formLogin()
                .successHandler(savedRequestAwareAuthenticationSuccessHandler())
                .defaultSuccessUrl("/home")
                .loginPage("/login")
                .loginProcessingUrl("/login")
                .permitAll()
                .and()
            .logout()
                .logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
                .logoutSuccessUrl("/login")
                .permitAll().and()
            .rememberMe()
                .rememberMeServices(rememberMeServices())
                .useSecureCookie(true).and()
            .headers().frameOptions().sameOrigin().and() // in future see if can path restrict this
            .csrf().csrfTokenRepository(new HttpSessionCsrfTokenRepository());
}
 
开发者ID:grassrootza,项目名称:grassroot-platform,代码行数:35,代码来源:SecurityConfig.java

示例5: csrfTokenRepository

import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository; //导入依赖的package包/类
private CsrfTokenRepository csrfTokenRepository() {
    HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
    /**
     * You'll see references to the X-XSRF-TOKEN header in the javascript code.
     */
    repository.setHeaderName("X-XSRF-TOKEN");
    return repository;
}
 
开发者ID:laran,项目名称:spring-data-rest-mvc-react,代码行数:9,代码来源:SecurityConfiguration.java

示例6: csrfTokenRepository

import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository; //导入依赖的package包/类
@Bean
protected CsrfTokenRepository csrfTokenRepository()
{
    HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
    repository.setHeaderName( "X-XSRF-TOKEN" );
    return repository;
}
 
开发者ID:cherimojava,项目名称:orchidae,代码行数:8,代码来源:cfgSecurity.java

示例7: getCsrfTokenRepository

import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository; //导入依赖的package包/类
@Bean
public CsrfTokenRepository getCsrfTokenRepository() {
    HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
    repository.setSessionAttributeName(CSRF_SESSION_ATTRIBUTE);
    repository.setParameterName(CSRF_PARAM_NAME);
    return repository;
}
 
开发者ID:alfio-event,项目名称:alf.io,代码行数:8,代码来源:WebSecurityConfig.java

示例8: csrfTokenRepository

import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository; //导入依赖的package包/类
private CsrfTokenRepository csrfTokenRepository() {
    HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
    repository.setHeaderName("X-XSRF-TOKEN");
    return repository;
}
 
开发者ID:scionaltera,项目名称:emergentmud,代码行数:6,代码来源:SecurityConfiguration.java

示例9: csrfTokenRepository

import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository; //导入依赖的package包/类
private CsrfTokenRepository csrfTokenRepository() {
	HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
	repository.setHeaderName("X-XSRF-TOKEN");
	return repository;
}
 
开发者ID:oncecloud,项目名称:devops-cstack,代码行数:6,代码来源:SecurityConfiguration.java

示例10: csrfTokenRepository

import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository; //导入依赖的package包/类
private CsrfTokenRepository csrfTokenRepository() {
    HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
    log.info(Json.toJson(repository));
    repository.setHeaderName(CSRF_HEADER_NAME);
    return repository;
}
 
开发者ID:vishal1997,项目名称:DiscussionPortal,代码行数:7,代码来源:DiscussionPortalApplication.java

示例11: csrfTokenRepository

import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository; //导入依赖的package包/类
/**
 * This method provides a new instance of {@code CsrfTokenRepository}
 *
 * @return the newly created {@code CsrfTokenRepository}
 */
@Bean
public CsrfTokenRepository csrfTokenRepository() {

  return new HttpSessionCsrfTokenRepository();
}
 
开发者ID:oasp,项目名称:oasp-tutorial-sources,代码行数:11,代码来源:WebSecurityBeansConfig.java

示例12: csrfTokenRepository

import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository; //导入依赖的package包/类
private CsrfTokenRepository csrfTokenRepository()
{
  HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
  repository.setHeaderName("X-XSRF-TOKEN");
  return repository;
}
 
开发者ID:kreinhard,项目名称:OpenViSu,代码行数:7,代码来源:SecurityConfiguration.java

示例13: csrfTokenRepository

import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository; //导入依赖的package包/类
@Bean
public CsrfTokenRepository csrfTokenRepository() {
    final HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
    repository.setHeaderName(CsrfCookieGeneratorFilter.ANGULAR_CSRF_DEFAULT_HEADER_NAME);
    return repository;
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:7,代码来源:WebSecurityConfig.java

示例14: csrfTokenRepository

import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository; //导入依赖的package包/类
@SuppressWarnings("unused")
private CsrfTokenRepository csrfTokenRepository() {
   	  HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
   	  repository.setHeaderName("X-XSRF-TOKEN");
   	  return repository;
   	}
 
开发者ID:denis-rodionov,项目名称:cityoffice,代码行数:7,代码来源:SecurityConfiguration.java

示例15: csrfTokenRepository

import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository; //导入依赖的package包/类
private CsrfTokenRepository csrfTokenRepository() {
    HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
    repository.setHeaderName("X-XSRF-TOKEN");//for AngularJS's built-in CSRF feature
    return repository;
}
 
开发者ID:restbucks,项目名称:restbucks-member,代码行数:6,代码来源:WebSecurityConfiguration.java


注:本文中的org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。