HADOOP-16069. Support configure ZK_DTSM_ZK_KERBEROS_PRINCIPAL in ZKDelegationTokenSecretManager using principal with Schema /_HOST. Contributed by luhuachao.
(cherry picked from commit 298f07abceb4bb854630c9058e1697d4ef3d2ae2)
This commit is contained in:
parent
56562b9117
commit
6ef3204d54
@ -52,6 +52,7 @@
|
||||
import org.apache.hadoop.classification.InterfaceAudience.Private;
|
||||
import org.apache.hadoop.classification.InterfaceStability.Unstable;
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
import org.apache.hadoop.security.SecurityUtil;
|
||||
import org.apache.hadoop.security.token.Token;
|
||||
import org.apache.hadoop.security.token.delegation.web.DelegationTokenManager;
|
||||
import org.apache.zookeeper.CreateMode;
|
||||
@ -221,6 +222,7 @@ private String setJaasConfiguration(Configuration config) throws Exception {
|
||||
}
|
||||
String principal =
|
||||
config.get(ZK_DTSM_ZK_KERBEROS_PRINCIPAL, "").trim();
|
||||
principal = SecurityUtil.getServerPrincipal(principal, "");
|
||||
if (principal == null || principal.length() == 0) {
|
||||
throw new IllegalArgumentException(ZK_DTSM_ZK_KERBEROS_PRINCIPAL
|
||||
+ " must be specified");
|
||||
|
Loading…
x
Reference in New Issue
Block a user