當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。