Commit e46bb972 by Tuomas Riihimäki

Add logging of successfull authentications

1 parent 58284cd7
......@@ -106,7 +106,7 @@ public class JaasBean implements MoyaRealmBeanRemote {
logger.info("logging in as anonymous!!!");
} else if (!user.checkPassword(password)) {
secubean.sendMessage(MoyaEventType.LOGIN_FAILED, eventUser, "Login failed: wrong password for username ", username);
secubean.sendMessage(MoyaEventType.LOGIN_FAILED, eventUser, "Login failed: wrong password for username: ", username);
eventUser = null;
user = null;
}
......@@ -125,6 +125,7 @@ public class JaasBean implements MoyaRealmBeanRemote {
eventUserFacade.flush();
eventUser.setCreator(eventUser);
}
secubean.sendMessage(MoyaEventType.LOGIN_SUCCESSFULL, eventUser, "User logged in with username: '", username, "' eventuser: ", eventUser);
} else {
secubean.sendMessage(MoyaEventType.LOGIN_FAILED, eventUserFacade.findByLogin(User.ANONYMOUS_LOGINNAME), "Login failed: Username not found: ", username);
}
......@@ -190,7 +191,7 @@ public class JaasBean implements MoyaRealmBeanRemote {
roleset.add(UserPermission.ANYUSER.getFullName());
if (usr == null) {
usr = permbean.getAnonEventUser();
roleset.add(SpecialPermission.ANONYMOUS.name());
}
......
......@@ -11,7 +11,8 @@ public enum MoyaEventType {
BANKING_MESSAGE(MoyaEventSource.SHOP),
PLACE_ERROR(MoyaEventSource.PLACEMAP),
ACCOUNTEVENT_INFO(MoyaEventSource.USER),
USER_PERMISSION_VIOLATION(MoyaEventSource.USER),
USER_PERMISSION_VIOLATION(MoyaEventSource.USER),
LOGIN_SUCCESSFULL(MoyaEventSource.USER),
;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!