From 1f564849154c6a4ae14ea7b6014f94aae11b6a26 Mon Sep 17 00:00:00 2001 From: chenson42 Date: Fri, 25 Apr 2014 12:18:22 +0000 Subject: [PATCH] 0001691: Additional Logging for compliance --- .../jumpmind/symmetric/web/AuthenticationInterceptor.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/symmetric-server/src/main/java/org/jumpmind/symmetric/web/AuthenticationInterceptor.java b/symmetric-server/src/main/java/org/jumpmind/symmetric/web/AuthenticationInterceptor.java index d6a1bad73b..8b91327314 100644 --- a/symmetric-server/src/main/java/org/jumpmind/symmetric/web/AuthenticationInterceptor.java +++ b/symmetric-server/src/main/java/org/jumpmind/symmetric/web/AuthenticationInterceptor.java @@ -29,11 +29,15 @@ import org.apache.commons.lang.StringUtils; import org.jumpmind.symmetric.model.Node; import org.jumpmind.symmetric.service.INodeService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Protect handlers by checking that the request is allowed. */ public class AuthenticationInterceptor implements IInterceptor { + + Logger log = LoggerFactory.getLogger(getClass()); public enum AuthenticationStatus { SYNC_DISABLED, REGISTRATION_REQUIRED, FORBIDDEN, ACCEPTED; @@ -58,14 +62,18 @@ public boolean before(HttpServletRequest req, HttpServletResponse resp) throws I AuthenticationStatus status = getAuthenticationStatus(nodeId, securityToken); if (AuthenticationStatus.ACCEPTED.equals(status)) { + log.debug("Node '{}' successfully authenticated", nodeId); return true; } else if (AuthenticationStatus.REGISTRATION_REQUIRED.equals(status)) { + log.debug("Node '{}' failed to authenticate. It was not regsitered", nodeId); ServletUtils.sendError(resp, WebConstants.REGISTRATION_REQUIRED); return false; } else if (AuthenticationStatus.SYNC_DISABLED.equals(status)) { + log.debug("Node '{}' failed to authenticate. It was not enabled", nodeId); ServletUtils.sendError(resp, WebConstants.SYNC_DISABLED); return false; } else { + log.debug("Node '{}' failed to authenticate. It had the wrong password", nodeId); ServletUtils.sendError(resp, HttpServletResponse.SC_FORBIDDEN); return false; }