@Bean public CsrfTokenRepository csrfTokenRepository() { HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository(); repository.setHeaderName("X-XSRF-TOKEN"); return repository; }
/** * define csrf header entry. * * @return csrf header entry */ @Bean public CsrfTokenRepository csrfTokenRepository() { final HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository(); repository.setHeaderName(ResourcePaths.XSRF_HEADER); return repository; }
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; }
@Bean protected CsrfTokenRepository csrfTokenRepository() { HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository(); repository.setHeaderName( "X-XSRF-TOKEN" ); return repository; }
@Bean public CsrfTokenRepository getCsrfTokenRepository() { HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository(); repository.setSessionAttributeName(CSRF_SESSION_ATTRIBUTE); repository.setParameterName(CSRF_PARAM_NAME); return repository; }
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; }
private CsrfTokenRepository csrfTokenRepository() { HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository(); repository.setHeaderName("X-XSRF-TOKEN"); return repository; }
private CsrfTokenRepository csrfTokenRepository() { HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository(); log.info(Json.toJson(repository)); repository.setHeaderName(CSRF_HEADER_NAME); return repository; }
/** * @param csrfTokenRepository the csrfTokenRepository to set */ @Inject public void setCsrfTokenRepository(CsrfTokenRepository csrfTokenRepository) { this.csrfTokenRepository = csrfTokenRepository; }
/** * This method provides a new instance of {@code CsrfTokenRepository} * * @return the newly created {@code CsrfTokenRepository} */ @Bean public CsrfTokenRepository csrfTokenRepository() { return new HttpSessionCsrfTokenRepository(); }
@Bean public CsrfTokenRepository csrfTokenRepository() { final HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository(); repository.setHeaderName(CsrfCookieGeneratorFilter.ANGULAR_CSRF_DEFAULT_HEADER_NAME); return repository; }
@SuppressWarnings("unused") private CsrfTokenRepository csrfTokenRepository() { HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository(); repository.setHeaderName("X-XSRF-TOKEN"); return repository; }
private CsrfTokenRepository csrfTokenRepository() { HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository(); repository.setHeaderName("X-XSRF-TOKEN");//for AngularJS's built-in CSRF feature return repository; }
/** * Configure CSRF token repository to accept CSRF token from AngularJS friendly header. * * @return CsrfTokenRepository */ private CsrfTokenRepository csrfTokenRepository() { HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository(); repository.setHeaderName(CsrfHeaderFilter.HEADER_NAME); return repository; }
CsrfTokenRepository csrfTokenRepository() { HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository(); repository.setHeaderName(XXSRFTOKEN); return repository; }
private CsrfTokenRepository csrfTokenRepository() { HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository(); repository.setSessionAttributeName("_csrf"); return repository; }
@Bean public CsrfTokenRepository csrfTokenRepository() { HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository(); repository.setHeaderName(MccyConstants.X_XSRF_TOKEN); return repository; }
/** * Method csrfTokenRepository creates repository for csrf security token * @return repository for csrf security token */ private CsrfTokenRepository csrfTokenRepository() { HttpSessionCsrfTokenRepository repository = new HttpSessionCsrfTokenRepository(); repository.setHeaderName("X-XSRF-TOKEN"); return repository; }