use of org.apache.hc.client5.http.auth.Credentials in project wildfly-clustering-spring-session by wildfly-clustering.
the class AuthSmokeITCase method createClient.
private static CloseableHttpClient createClient(URL url1, URL url2) {
CredentialsStore provider = new BasicCredentialsProvider();
Credentials credentials = new UsernamePasswordCredentials("admin", "password".toCharArray());
provider.setCredentials(new AuthScope(url1.getHost(), url1.getPort()), credentials);
provider.setCredentials(new AuthScope(url2.getHost(), url2.getPort()), credentials);
return HttpClients.custom().setDefaultCredentialsProvider(provider).build();
}
use of org.apache.hc.client5.http.auth.Credentials in project wildfly-clustering-spring-session by wildfly-clustering.
the class AuthSmokeITCase method createClient.
private static CloseableHttpClient createClient(URL url1, URL url2) {
CredentialsStore provider = new BasicCredentialsProvider();
Credentials credentials = new UsernamePasswordCredentials("admin", "password".toCharArray());
provider.setCredentials(new AuthScope(url1.getHost(), url1.getPort()), credentials);
provider.setCredentials(new AuthScope(url2.getHost(), url2.getPort()), credentials);
return HttpClients.custom().setDefaultCredentialsProvider(provider).build();
}
Aggregations