Repository: ambari Updated Branches: refs/heads/branch-2.5 9a2d32232 -> dd0d876e1
AMBARI-19692. LDAP regression in Ambari 2.4: Login alias is not resolved during authentication (oleewere) Change-Id: I91da4344bc8cbfdb4863c973312c75ac21464066 Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/dd0d876e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/dd0d876e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/dd0d876e Branch: refs/heads/branch-2.5 Commit: dd0d876e1ed7e0e3bde78fa42b004f901fe0d7ab Parents: 9a2d322 Author: oleewere <[email protected]> Authored: Tue Jan 24 15:24:59 2017 +0100 Committer: oleewere <[email protected]> Committed: Wed Jan 25 12:01:33 2017 +0100 ---------------------------------------------------------------------- .../authorization/AmbariLdapAuthenticationProvider.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/dd0d876e/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProvider.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProvider.java index b5776a3..f5b7aa5 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProvider.java @@ -193,18 +193,18 @@ public class AmbariLdapAuthenticationProvider implements AuthenticationProvider } private Integer getUserId(Authentication authentication) { - String userName = authentication.getName(); + String userName = AuthorizationHelper.resolveLoginAliasToUserName(authentication.getName()); UserEntity userEntity = userDAO.findLdapUserByName(userName); // lookup is case insensitive, so no need for string comparison if (userEntity == null) { - LOG.info("user not found "); + LOG.info("user not found ('{}')", userName); throw new InvalidUsernamePasswordCombinationException(); } if (!userEntity.getActive()) { - LOG.debug("User account is disabled"); + LOG.debug("User account is disabled ('{}')", userName); throw new InvalidUsernamePasswordCombinationException(); }
