@EventObserver
  public void onAuthenticationFailed(UserAuthenticationFailedEvent event) {
    HashMap<String, Object> map = new HashMap<String, Object>();

    AuditEvent auditRecord = new AuditEvent(AuditType.AUTHENTICATION, map, event.getException());

    auditRecord.setUserContext(event.getUserContext());
    auditRecord.setDescription("Authentication failed");

    this.auditProvider.audit(auditRecord);
  }
  @EventObserver
  public void onUnSuccessfulAuthentication(UserNotAuthenticatedEvent event) {
    HashMap<String, Object> map = new HashMap<String, Object>();

    AuditEvent auditRecord = new AuditEvent(AuditType.AUTHENTICATION, map);

    auditRecord.setUserContext(event.getUserContext());
    auditRecord.setDescription("Invalid user");

    this.auditProvider.audit(auditRecord);
  }