You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2017/01/25 18:57:32 UTC

[43/50] [abbrv] ambari git commit: AMBARI-19692. LDAP regression in Ambari 2.4: Login alias is not resolved during authentication (oleewere)

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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 18e58ffb3759819155261f7e3e68491f330ecd02
Parents: dab389d
Author: oleewere <ol...@gmail.com>
Authored: Tue Jan 24 15:24:59 2017 +0100
Committer: oleewere <ol...@gmail.com>
Committed: Wed Jan 25 12:07:36 2017 +0100

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/18e58ffb/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 552be1e..a35e7eb 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
@@ -194,18 +194,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();
     }