mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Change check of token.getUsername() in doGetAuthenticationInfo by using StringUtils::isBlank instead of checking only null.
This commit is contained in:
parent
38683e17a3
commit
c207b5e402
1 changed files with 2 additions and 2 deletions
|
|
@ -77,8 +77,8 @@ public class ZeppelinHubRealm extends AuthorizingRealm {
|
|||
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authToken)
|
||||
throws AuthenticationException {
|
||||
UsernamePasswordToken token = (UsernamePasswordToken) authToken;
|
||||
if (token.getUsername() == null) {
|
||||
throw new AccountException("Null usernames are not allowed by this realm.");
|
||||
if (StringUtils.isBlank(token.getUsername())) {
|
||||
throw new AccountException("Empty usernames are not allowed by this realm.");
|
||||
}
|
||||
String loginPayload = createLoginPayload(token.getUsername(), token.getPassword());
|
||||
User user = authenticateUser(loginPayload);
|
||||
|
|
|
|||
Loading…
Reference in a new issue