use of com.sun.jersey.api.client.filter.HTTPBasicAuthFilter in project data-access by pentaho.
the class TestDataSourceResource method init.
private static void init() {
ClientConfig clientConfig = new DefaultClientConfig();
client = Client.create(clientConfig);
client.addFilter(new HTTPBasicAuthFilter("joe", "password"));
}
use of com.sun.jersey.api.client.filter.HTTPBasicAuthFilter 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