Skip to content
Permalink
Browse files
Merge branch 'pr/10'
[MRM-1923] merge pr
  • Loading branch information
olamy committed Sep 13, 2016
2 parents 8e98a8a + 5ce2714 commit 11b2cdbae00e3f0d0ff8ff1fb0b374471de713da
Showing 1 changed file with 14 additions and 7 deletions.
@@ -122,18 +122,25 @@ public AuthenticationResult authenticate( AuthenticationDataSource s )

results = context.search( mapper.getUserBaseDn(), filter, ctls );

log.debug( "Found user '{}': {}", source.getUsername(), results.hasMoreElements() );
boolean moreElements = results.hasMoreElements();

if ( results.hasMoreElements() )
log.debug( "Found user '{}': {}", source.getUsername(), moreElements );

if ( moreElements )
{
SearchResult result = results.nextElement();
try {
SearchResult result = results.nextElement();

userDn = result.getNameInNamespace();
userDn = result.getNameInNamespace();

log.debug( "Adding userDn {} for user {} to the cache..", userDn, source.getUsername() );
log.debug("Adding userDn {} for user {} to the cache..", userDn, source.getUsername());

// REDBACK-289/MRM-1488 cache the ldap user's userDn to lessen calls to ldap server
ldapCacheService.addLdapUserDn( source.getUsername(), userDn );
// REDBACK-289/MRM-1488 cache the ldap user's userDn to lessen calls to ldap server
ldapCacheService.addLdapUserDn(source.getUsername(), userDn);
} catch (Exception e) {
log.error("Error occured on LDAP result retrieval: {}, {}", userDn, e.getMessage());
return new AuthenticationResult( false, source.getUsername(), e);
}
}
else
{

0 comments on commit 11b2cdb

Please sign in to comment.