use of io.jans.as.server.model.audit.Action in project jans by JanssenProject.
the class SessionIdService method auditLogging.
private void auditLogging(SessionId sessionId) {
HttpServletRequest httpServletRequest = ServerUtil.getRequestOrNull();
if (httpServletRequest != null) {
Action action;
switch(sessionId.getState()) {
case AUTHENTICATED:
action = Action.SESSION_AUTHENTICATED;
break;
case UNAUTHENTICATED:
action = Action.SESSION_UNAUTHENTICATED;
break;
default:
action = Action.SESSION_UNAUTHENTICATED;
}
OAuth2AuditLog oAuth2AuditLog = new OAuth2AuditLog(ServerUtil.getIpAddress(httpServletRequest), action);
oAuth2AuditLog.setSuccess(true);
applicationAuditLogger.sendMessage(oAuth2AuditLog);
}
}
Aggregations