authenticationSuccess = true;
user.setCountFailedLoginAttempts( 0 );
userManager.updateUser( user );
return new AuthenticationResult( true, source.getPrincipal(), null );
}
else
{
getLogger().warn( "Password is Invalid for user " + source.getPrincipal() + "." );
authnResultExceptionsMap.put( AuthenticationConstants.AUTHN_NO_SUCH_USER,
"Password is Invalid for user " + source.getPrincipal() + "." );
try
{
securityPolicy.extensionExcessiveLoginAttempts( user );
}
finally
{
userManager.updateUser( user );
}
return new AuthenticationResult( false, source.getPrincipal(), null, authnResultExceptionsMap );
}
}
catch ( UserNotFoundException e )
{
getLogger().warn( "Login for user " + source.getPrincipal() + " failed. user not found." );
resultException = e;
authnResultExceptionsMap.put( AuthenticationConstants.AUTHN_NO_SUCH_USER,
"Login for user \" + source.getPrincipal() + \" failed. user not found." );
}
return new AuthenticationResult(authenticationSuccess, username, resultException, authnResultExceptionsMap );
}