Repository: hadoop
Updated Branches:
  refs/heads/trunk 51cb6c538 -> b6e50fad5


YARN-7831. YARN Service CLI should use hadoop.http.authentication.type to 
determine authentication method. Contributed by Eric Yang


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/b6e50fad
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/b6e50fad
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/b6e50fad

Branch: refs/heads/trunk
Commit: b6e50fad53f26e2b718a85ec0678e3161decc691
Parents: 51cb6c5
Author: Jian He <jia...@apache.org>
Authored: Fri Feb 2 14:37:58 2018 -0800
Committer: Jian He <jia...@apache.org>
Committed: Fri Feb 2 14:38:33 2018 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/yarn/service/client/ApiServiceClient.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/b6e50fad/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/client/ApiServiceClient.java
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/client/ApiServiceClient.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/client/ApiServiceClient.java
index 8c2edb5..cb91946 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/client/ApiServiceClient.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/client/ApiServiceClient.java
@@ -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);
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to