本文整理匯總了Java中org.springframework.security.web.csrf.CsrfTokenRepository類的典型用法代碼示例。如果您正苦於以下問題:Java CsrfTokenRepository類的具體用法?Java CsrfTokenRepository怎麽用?Java CsrfTokenRepository使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
CsrfTokenRepository類屬於org.springframework.security.web.csrf包,在下文中一共展示了CsrfTokenRepository類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: csrfTokenRepository
import org.springframework.security.web.csrf.CsrfTokenRepository; //導入依賴的package包/類
@Bean
public CsrfTokenRepository csrfTokenRepository() {
HttpSessionCsrfTokenRepository repository =
new HttpSessionCsrfTokenRepository();
repository.setHeaderName("X-XSRF-TOKEN");
return repository;
}
示例2: csrfTokenRepository
import org.springframework.security.web.csrf.CsrfTokenRepository; //導入依賴的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;
}
示例3: csrfTokenRepository
import org.springframework.security.web.csrf.CsrfTokenRepository; //導入依賴的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;
}
示例4: csrfTokenRepository
import org.springframework.security.web.csrf.CsrfTokenRepository; //導入依賴的package包/類
@Bean
protected CsrfTokenRepository csrfTokenRepository()
{
HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
repository.setHeaderName( "X-XSRF-TOKEN" );
return repository;
}
示例5: getCsrfTokenRepository
import org.springframework.security.web.csrf.CsrfTokenRepository; //導入依賴的package包/類
@Bean
public CsrfTokenRepository getCsrfTokenRepository() {
HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
repository.setSessionAttributeName(CSRF_SESSION_ATTRIBUTE);
repository.setParameterName(CSRF_PARAM_NAME);
return repository;
}
示例6: createSpringTokenRepo
import org.springframework.security.web.csrf.CsrfTokenRepository; //導入依賴的package包/類
private static SpringCsrfTokenRepository createSpringTokenRepo()
{
HttpServletRequest request = createNiceMock(HttpServletRequest.class);
HttpServletResponse response = createNiceMock(HttpServletResponse.class);
CsrfTokenRepository springCsrfTokenRepository = createNiceMock(CsrfTokenRepository.class);
expect(springCsrfTokenRepository.generateToken(EasyMock.anyObject(HttpServletRequest.class)))
.andReturn(SPRING_TOKEN);
expect(springCsrfTokenRepository.loadToken(EasyMock.anyObject(HttpServletRequest.class)))
.andReturn(SPRING_TOKEN);
replay(request, response, springCsrfTokenRepository);
SpringCsrfTokenRepository csrfTokenRepository =
new SpringCsrfTokenRepository(springCsrfTokenRepository, request, response);
return csrfTokenRepository;
}
開發者ID:porscheinformatik,項目名稱:tapestry-csrf-protection,代碼行數:15,代碼來源:SpringCsrfTokenRepositoryTest.java
示例7: csrfTokenRepository
import org.springframework.security.web.csrf.CsrfTokenRepository; //導入依賴的package包/類
private CsrfTokenRepository csrfTokenRepository() {
HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
repository.setHeaderName("X-XSRF-TOKEN");
return repository;
}
示例8: csrfTokenRepository
import org.springframework.security.web.csrf.CsrfTokenRepository; //導入依賴的package包/類
private CsrfTokenRepository csrfTokenRepository() {
HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
repository.setHeaderName("X-XSRF-TOKEN");
return repository;
}
示例9: csrfTokenRepository
import org.springframework.security.web.csrf.CsrfTokenRepository; //導入依賴的package包/類
private CsrfTokenRepository csrfTokenRepository() {
HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
log.info(Json.toJson(repository));
repository.setHeaderName(CSRF_HEADER_NAME);
return repository;
}
示例10: setCsrfTokenRepository
import org.springframework.security.web.csrf.CsrfTokenRepository; //導入依賴的package包/類
/**
* @param csrfTokenRepository the csrfTokenRepository to set
*/
@Inject
public void setCsrfTokenRepository(CsrfTokenRepository csrfTokenRepository) {
this.csrfTokenRepository = csrfTokenRepository;
}
示例11: csrfTokenRepository
import org.springframework.security.web.csrf.CsrfTokenRepository; //導入依賴的package包/類
/**
* This method provides a new instance of {@code CsrfTokenRepository}
*
* @return the newly created {@code CsrfTokenRepository}
*/
@Bean
public CsrfTokenRepository csrfTokenRepository() {
return new HttpSessionCsrfTokenRepository();
}
示例12: csrfTokenRepository
import org.springframework.security.web.csrf.CsrfTokenRepository; //導入依賴的package包/類
private CsrfTokenRepository csrfTokenRepository()
{
HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
repository.setHeaderName("X-XSRF-TOKEN");
return repository;
}
示例13: csrfTokenRepository
import org.springframework.security.web.csrf.CsrfTokenRepository; //導入依賴的package包/類
@Bean
public CsrfTokenRepository csrfTokenRepository() {
final HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
repository.setHeaderName(CsrfCookieGeneratorFilter.ANGULAR_CSRF_DEFAULT_HEADER_NAME);
return repository;
}
示例14: csrfTokenRepository
import org.springframework.security.web.csrf.CsrfTokenRepository; //導入依賴的package包/類
@SuppressWarnings("unused")
private CsrfTokenRepository csrfTokenRepository() {
HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
repository.setHeaderName("X-XSRF-TOKEN");
return repository;
}
示例15: csrfTokenRepository
import org.springframework.security.web.csrf.CsrfTokenRepository; //導入依賴的package包/類
private CsrfTokenRepository csrfTokenRepository() {
HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository();
repository.setHeaderName("X-XSRF-TOKEN");//for AngularJS's built-in CSRF feature
return repository;
}