Search in sources :

Example 1 with Action

use of org.xdi.oxauth.model.audit.Action in project oxAuth by GluuFederation.

the class SessionStateService method auditLogging.

private void auditLogging(SessionState sessionState) {
    HttpServletRequest httpServletRequest = ServerUtil.getRequestOrNull();
    if (httpServletRequest != null) {
        Action action;
        switch(sessionState.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);
    }
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) Action(org.xdi.oxauth.model.audit.Action) OAuth2AuditLog(org.xdi.oxauth.model.audit.OAuth2AuditLog)

Aggregations

HttpServletRequest (javax.servlet.http.HttpServletRequest)1 Action (org.xdi.oxauth.model.audit.Action)1 OAuth2AuditLog (org.xdi.oxauth.model.audit.OAuth2AuditLog)1