YARN-7831. YARN Service CLI should use hadoop.http.authentication.type to determine authentication method. Contributed by Eric Yang
This commit is contained in:
parent
51cb6c5380
commit
b6e50fad53
|
@ -123,7 +123,8 @@ public class ApiServiceClient extends AppAdminClient {
|
|||
api.append("/");
|
||||
api.append(appName);
|
||||
}
|
||||
if (!UserGroupInformation.isSecurityEnabled()) {
|
||||
Configuration conf = getConfig();
|
||||
if (conf.get("hadoop.http.authentication.type").equalsIgnoreCase("simple")) {
|
||||
api.append("?user.name=" + UrlEncoded
|
||||
.encodeString(System.getProperty("user.name")));
|
||||
}
|
||||
|
@ -147,7 +148,7 @@ public class ApiServiceClient extends AppAdminClient {
|
|||
client.setChunkedEncodingSize(null);
|
||||
Builder builder = client
|
||||
.resource(getApiUrl(appName)).type(MediaType.APPLICATION_JSON);
|
||||
if (conf.get("hadoop.security.authentication").equals("kerberos")) {
|
||||
if (conf.get("hadoop.http.authentication.type").equals("kerberos")) {
|
||||
AuthenticatedURL.Token token = new AuthenticatedURL.Token();
|
||||
builder.header("WWW-Authenticate", token);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue