YARN-9334. Allow YARN Service client to send SPNEGO challenge header when authentication type is not simple.
Contributed by Billie Rinaldi
(cherry picked from commit 04b228e43b
)
This commit is contained in:
parent
817028364a
commit
72eacb3e10
|
@ -281,11 +281,10 @@ public class ApiServiceClient extends AppAdminClient {
|
||||||
private Builder getApiClient(String requestPath)
|
private Builder getApiClient(String requestPath)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
Client client = Client.create(getClientConfig());
|
Client client = Client.create(getClientConfig());
|
||||||
Configuration conf = getConfig();
|
|
||||||
client.setChunkedEncodingSize(null);
|
client.setChunkedEncodingSize(null);
|
||||||
Builder builder = client
|
Builder builder = client
|
||||||
.resource(requestPath).type(MediaType.APPLICATION_JSON);
|
.resource(requestPath).type(MediaType.APPLICATION_JSON);
|
||||||
if (conf.get("hadoop.http.authentication.type").equals("kerberos")) {
|
if (UserGroupInformation.isSecurityEnabled()) {
|
||||||
try {
|
try {
|
||||||
URI url = new URI(requestPath);
|
URI url = new URI(requestPath);
|
||||||
String challenge = generateToken(url.getHost());
|
String challenge = generateToken(url.getHost());
|
||||||
|
|
Loading…
Reference in New Issue