hn5092 commented on a change in pull request #676: KYLIN-4033 Can not access 
Kerberized Cluster with DebugTomcat
URL: https://github.com/apache/kylin/pull/676#discussion_r292726635
 
 

 ##########
 File path: server/src/main/java/org/apache/kylin/rest/DebugTomcat.java
 ##########
 @@ -99,6 +107,25 @@ private static File findFile(String dir, String ptn) {
         }
         return null;
     }
+    public static boolean isKerberosEnabled() {
+        Configuration conf = new Configuration();
+        boolean authEnabled = conf.getBoolean("hadoop.security.authorization", 
false);
+        String authMethod = conf.get("hadoop.security.authentication");
+        return authEnabled && 
authMethod.toLowerCase(Locale.ROOT).equals("kerberos");
+    }
+
+    public static void authKrb5() {
+        System.setProperty("java.security.krb5.conf", "/etc/krb5.conf");
+        Configuration conf = new Configuration();
+        UserGroupInformation.setConfiguration(conf);
+        try {
+            UserGroupInformation.loginUserFromKeytab(
 
 Review comment:
   Use another way? Systemprop or env and noted to dev doc.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to