Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 3b9056bac -> 71db67fbe


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/71db67fb
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/71db67fb
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/71db67fb

Branch: refs/heads/branch-2.4
Commit: 71db67fbe8d07b1cfcf04ef3f1cc6eb7d0e071bb
Parents: 3b9056b
Author: oleewere <oleew...@gmail.com>
Authored: Tue Jan 24 15:24:59 2017 +0100
Committer: oleewere <oleew...@gmail.com>
Committed: Wed Jan 25 12:05:07 2017 +0100

----------------------------------------------------------------------
 .../authorization/AmbariLdapAuthenticationProvider.java        | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/71db67fb/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 6905757..ac16730 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
@@ -190,18 +190,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();
     }

Reply via email to