[KYUUBI #712] add a new config property authentication.ldap.guidKey
for fix issues : https://github.com/NetEase/kyuubi/issues/709 my ldap env use cn but uid for login, uid is the defaut behavior by kyuubi :  then try to connect kyuubi :   change kyuubi behavior to use cn:  then try to connect kyuubi :  Closes #712 from lordk911/branch-1.2. Closes #712 0ab1a5b0 [kshen] add a new config property authentication.ldap.guidKey 24fb1bc3 [kshen] add a new config property authentication.ldap.guidKey Authored-by: kshen <kshen@gaojihealth.com> Signed-off-by: Kent Yao <yao@apache.org>
This commit is contained in:
parent
a6ab236b33
commit
3b0852d0c6
@ -105,6 +105,7 @@ Key | Default | Meaning | Type | Since
|
||||
kyuubi\.authentication|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>NONE</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Client authentication types.<ul> <li>NOSASL: raw transport.</li> <li>NONE: no authentication check.</li> <li>KERBEROS: Kerberos/GSSAPI authentication.</li> <li>LDAP: Lightweight Directory Access Protocol authentication.</li></ul></div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
kyuubi\.authentication<br>\.ldap\.base\.dn|<div style='width: 65pt;word-wrap: break-word;white-space: normal'><undefined></div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>LDAP base DN.</div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
kyuubi\.authentication<br>\.ldap\.domain|<div style='width: 65pt;word-wrap: break-word;white-space: normal'><undefined></div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>LDAP domain.</div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
kyuubi\.authentication<br>\.ldap\.guidKey|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>uid</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>LDAP attribute name whose values are unique in this LDAP server.For example:uid or cn.</div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.2.0</div>
|
||||
kyuubi\.authentication<br>\.ldap\.url|<div style='width: 65pt;word-wrap: break-word;white-space: normal'><undefined></div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>SPACE character separated LDAP connection URL(s).</div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
kyuubi\.authentication<br>\.sasl\.qop|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>auth</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Sasl QOP enable higher levels of protection for Kyuubi communication with clients.<ul> <li>auth - authentication only (default)</li> <li>auth-int - authentication plus integrity protection</li> <li>auth-conf - authentication plus integrity and confidentiality protection. This is applicable only if Kyuubi is configured to use Kerberos authentication.</li> </ul></div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
|
||||
|
||||
@ -314,6 +314,14 @@ object KyuubiConf {
|
||||
.stringConf
|
||||
.createOptional
|
||||
|
||||
val AUTHENTICATION_LDAP_GUIDKEY: ConfigEntry[String] =
|
||||
buildConf("authentication.ldap.guidKey")
|
||||
.doc("LDAP attribute name whose values are unique in this LDAP server." +
|
||||
"For example:uid or cn.")
|
||||
.version("1.2.0")
|
||||
.stringConf
|
||||
.createWithDefault("uid")
|
||||
|
||||
val DELEGATION_KEY_UPDATE_INTERVAL: ConfigEntry[Long] =
|
||||
buildConf("delegation.key.update.interval")
|
||||
.doc("unused yet")
|
||||
|
||||
@ -64,8 +64,9 @@ class LdapAuthenticationProviderImpl(conf: KyuubiConf) extends PasswdAuthenticat
|
||||
user
|
||||
}
|
||||
|
||||
val guidKey = conf.get(AUTHENTICATION_LDAP_GUIDKEY)
|
||||
val bindDn = conf.get(AUTHENTICATION_LDAP_BASEDN) match {
|
||||
case Some(dn) => "uid=" + u + "," + dn
|
||||
case Some(dn) => guidKey + "=" + u + "," + dn
|
||||
case _ => u
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user