use of org.apache.http.auth.BasicUserPrincipal in project knox by apache.
the class SecureClusterTest method getHttpClient.
private CloseableHttpClient getHttpClient() {
CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(AuthScope.ANY, new Credentials() {
@Override
public Principal getUserPrincipal() {
return new BasicUserPrincipal("guest");
}
@Override
public String getPassword() {
return "guest-password";
}
});
return HttpClients.custom().setDefaultCredentialsProvider(credentialsProvider).build();
}
Aggregations