fix ldap none.get
This commit is contained in:
parent
9da3400651
commit
af9babe0b6
@ -58,7 +58,7 @@ class LdapAuthenticationProviderImpl(conf: KyuubiConf) extends PasswdAuthenticat
|
|||||||
|
|
||||||
val domain = conf.get(AUTHENTICATION_LDAP_DOMAIN)
|
val domain = conf.get(AUTHENTICATION_LDAP_DOMAIN)
|
||||||
val u = if (!hasDomain(user) && domain.nonEmpty) {
|
val u = if (!hasDomain(user) && domain.nonEmpty) {
|
||||||
user + "@" + domain
|
user + "@" + domain.get
|
||||||
} else {
|
} else {
|
||||||
user
|
user
|
||||||
}
|
}
|
||||||
|
|||||||
@ -181,5 +181,9 @@ class LdapAuthenticationProviderImplSuite extends KyuubiFunSuite {
|
|||||||
|
|
||||||
assert(e5.getMessage.contains(user))
|
assert(e5.getMessage.contains(user))
|
||||||
assert(e5.getCause.isInstanceOf[CommunicationException])
|
assert(e5.getCause.isInstanceOf[CommunicationException])
|
||||||
|
|
||||||
|
conf.set(AUTHENTICATION_LDAP_DOMAIN, "kyuubi.com")
|
||||||
|
val providerImpl4 = new LdapAuthenticationProviderImpl(conf)
|
||||||
|
intercept[AuthenticationException](providerImpl4.authenticate("kentyao", "kentyao"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user