use of org.apache.http.impl.auth.SPNegoScheme in project hadoop by apache.
the class AuthenticatorTestCase method getHttpClient.
private HttpClient getHttpClient() {
HttpClientBuilder builder = HttpClientBuilder.create();
// Register auth schema
builder.setDefaultAuthSchemeRegistry(s -> httpContext -> new SPNegoScheme(true, true));
Credentials useJaasCreds = new Credentials() {
public String getPassword() {
return null;
}
public Principal getUserPrincipal() {
return null;
}
};
CredentialsProvider jaasCredentialProvider = new BasicCredentialsProvider();
jaasCredentialProvider.setCredentials(AuthScope.ANY, useJaasCreds);
// Set credential provider
builder.setDefaultCredentialsProvider(jaasCredentialProvider);
return builder.build();
}
Aggregations