File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
core/src/main/java/com/dtstack/flink/sql/util Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 2020
2121import org .apache .hadoop .conf .Configuration ;
2222import org .apache .hadoop .security .UserGroupInformation ;
23+ import org .slf4j .Logger ;
24+ import org .slf4j .LoggerFactory ;
2325
2426import java .io .IOException ;
2527
3032 **/
3133public class KrbUtils {
3234
35+ private static final Logger LOG = LoggerFactory .getLogger (KrbUtils .class );
36+
3337 public static final String KRB5_CONF_KEY = "java.security.krb5.conf" ;
3438 public static final String HADOOP_AUTH_KEY = "hadoop.security.authentication" ;
3539 public static final String KRB_STR = "Kerberos" ;
40+ // public static final String FALSE_STR = "false";
41+ // public static final String SUBJECT_ONLY_KEY = "javax.security.auth.useSubjectCredsOnly";
3642
3743 public static UserGroupInformation getUgi (String principal , String keytabPath , String krb5confPath ) throws IOException {
44+ LOG .info ("Kerberos login with principal: {} and keytab: {}" , principal , keytabPath );
3845 System .setProperty (KRB5_CONF_KEY , krb5confPath );
46+ // TODO 尚未探索出此选项的意义,以后研究明白方可打开
47+ // System.setProperty(SUBJECT_ONLY_KEY, FALSE_STR);
3948 Configuration configuration = new Configuration ();
4049 configuration .set (HADOOP_AUTH_KEY , KRB_STR );
4150 UserGroupInformation .setConfiguration (configuration );
You can’t perform that action at this time.
0 commit comments