From d852fe3356ada2f5a1c7370ce124897e8962564a Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 22 Nov 2012 22:16:43 +0000 Subject: [PATCH] reduce logs git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1412693 13f79535-47bb-0310-9956-ffa450edef68 --- .../authentication/ldap/LdapBindAuthenticator.java | 8 +++++--- .../redback/users/ldap/ctl/DefaultLdapController.java | 7 +++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/redback-authentication/redback-authentication-providers/redback-authentication-ldap/src/main/java/org/apache/archiva/redback/authentication/ldap/LdapBindAuthenticator.java b/redback-authentication/redback-authentication-providers/redback-authentication-ldap/src/main/java/org/apache/archiva/redback/authentication/ldap/LdapBindAuthenticator.java index a66e88bf..fa50c465 100644 --- a/redback-authentication/redback-authentication-providers/redback-authentication-ldap/src/main/java/org/apache/archiva/redback/authentication/ldap/LdapBindAuthenticator.java +++ b/redback-authentication/redback-authentication-providers/redback-authentication-ldap/src/main/java/org/apache/archiva/redback/authentication/ldap/LdapBindAuthenticator.java @@ -98,7 +98,7 @@ public class LdapBindAuthenticator + ( mapper.getUserFilter() != null ? mapper.getUserFilter() : "" ) + "(" + mapper.getUserIdAttribute() + "=" + source.getPrincipal() + "))"; - log.info( "Searching for users with filter: '{}' from base dn: {}", filter, mapper.getUserBaseDn() ); + log.debug( "Searching for users with filter: '{}' from base dn: {}", filter, mapper.getUserBaseDn() ); LdapConnection ldapConnection = getLdapConnection(); LdapConnection authLdapConnection = null; @@ -116,7 +116,7 @@ public class LdapBindAuthenticator results = context.search( mapper.getUserBaseDn(), filter, ctls ); - log.info( "Found user?: {}", results.hasMoreElements() ); + log.debug( "Found user '{}': {}", source.getPrincipal(), results.hasMoreElements() ); if ( results.hasMoreElements() ) { @@ -135,10 +135,12 @@ public class LdapBindAuthenticator } } - log.info( "Attempting Authenication: {}", userDn ); + log.debug( "Attempting Authenication: {}", userDn ); authLdapConnection = connectionFactory.getConnection( userDn, source.getPassword() ); + log.info( "user '{}' authenticated", source.getPrincipal() ); + return new AuthenticationResult( true, source.getPrincipal(), null ); } catch ( LdapException e ) diff --git a/redback-users/redback-users-providers/redback-users-ldap/src/main/java/org/apache/archiva/redback/users/ldap/ctl/DefaultLdapController.java b/redback-users/redback-users-providers/redback-users-ldap/src/main/java/org/apache/archiva/redback/users/ldap/ctl/DefaultLdapController.java index c5471572..aa9c175b 100644 --- a/redback-users/redback-users-providers/redback-users-ldap/src/main/java/org/apache/archiva/redback/users/ldap/ctl/DefaultLdapController.java +++ b/redback-users/redback-users-providers/redback-users-ldap/src/main/java/org/apache/archiva/redback/users/ldap/ctl/DefaultLdapController.java @@ -144,7 +144,7 @@ public class DefaultLdapController String finalFilter = "(&(objectClass=" + mapper.getUserObjectClass() + ")" + ( mapper.getUserFilter() != null ? mapper.getUserFilter() : "" ) + query.getLdapFilter(mapper) + ")"; - log.info( "Searching for users with filter: \'{}\'" + " from base dn: {}",finalFilter, mapper.getUserBaseDn() ); + log.debug( "Searching for users with filter: '{}'" + " from base dn: {}",finalFilter, mapper.getUserBaseDn() ); return context.search( mapper.getUserBaseDn(), finalFilter, ctls ); } @@ -257,7 +257,8 @@ public class DefaultLdapController { String username = key.toString(); - log.info( "Searching for user: {}", username ); + log.debug( "Searching for user: {}", username ); + LdapUserQuery query = new LdapUserQuery(); query.setUsername( username ); @@ -270,6 +271,8 @@ public class DefaultLdapController { SearchResult next = result.nextElement(); + log.info( "Found user: {}", username ); + return mapper.getUser( next.getAttributes() ); } else