Skip to content

Commit 4ccc19a

Browse files
committed
Added user name for login audit
Added user name for login audit logging
1 parent ec1abdc commit 4ccc19a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.keybox</groupId>
66
<artifactId>keybox</artifactId>
7-
<version>2.85.00-SNAPSHOT</version>
7+
<version>2.85.00</version>
88
<packaging>war</packaging>
99
<name>KeyBox</name>
1010
<properties>

src/main/java/com/keybox/manage/action/LoginAction.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ public String loginSubmit() {
9898
if (otpEnabled) {
9999
sharedSecret = AuthDB.getSharedSecret(user.getId());
100100
if (StringUtils.isNotEmpty(sharedSecret) && (auth.getOtpToken() == null || !OTPUtil.verifyToken(sharedSecret, auth.getOtpToken()))) {
101-
loginAuditLogger.info(clientIP + " " + AUTH_ERROR);
101+
loginAuditLogger.info(auth.getUsername() + " (" + clientIP + ") - " + AUTH_ERROR);
102102
addActionError(AUTH_ERROR);
103103
return INPUT;
104104
}
105105
}
106106
//check to see if admin has any assigned profiles
107107
if(!User.MANAGER.equals(user.getUserType()) && (user.getProfileList()==null || user.getProfileList().size()<=0)){
108-
loginAuditLogger.info(clientIP + " " + AUTH_ERROR_NO_PROFILE);
108+
loginAuditLogger.info(auth.getUsername() + " (" + clientIP + ") - " + AUTH_ERROR_NO_PROFILE);
109109
addActionError(AUTH_ERROR_NO_PROFILE);
110110
return INPUT;
111111
}
@@ -121,11 +121,11 @@ public String loginSubmit() {
121121
} else if ("changeme".equals(auth.getPassword()) && Auth.AUTH_BASIC.equals(user.getAuthType())) {
122122
retVal = "change_password";
123123
}
124-
loginAuditLogger.info(clientIP + " Authentication Success");
124+
loginAuditLogger.info(auth.getUsername() + " (" + clientIP + ") - Authentication Success");
125125
}
126126

127127
} else {
128-
loginAuditLogger.info(clientIP + " " + AUTH_ERROR);
128+
loginAuditLogger.info(auth.getUsername() + " (" + clientIP + ") - " + AUTH_ERROR);
129129
addActionError(AUTH_ERROR);
130130
retVal = INPUT;
131131
}

0 commit comments

Comments
 (0)