use of com.hitachivantara.security.web.impl.client.csrf.jaxrsv1.util.SessionCookiesFilter in project pentaho-platform by pentaho.
the class CommandLineProcessor method initRestService.
/**
* Used only for REST Jersey calls
*
* @param contextURL The Pentaho server web application base URL.
*/
private void initRestService(String contextURL) throws ParseException, KettleException, URISyntaxException {
ClientConfig clientConfig = new DefaultClientConfig();
clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
client = Client.create(clientConfig);
client.addFilter(new HTTPBasicAuthFilter(getUsername(), getPassword()));
client.addFilter(new SessionCookiesFilter(new CookieManager()));
client.addFilter(new CsrfTokenFilter(new URI(contextURL + API_CSRF_TOKEN)));
}
Aggregations