@Override
  public void onSuccessfulAuthentication(AmbariAuthenticationFilter filter, HttpServletRequest servletRequest, HttpServletResponse servletResponse, Authentication result) {
    String username = (result == null) ? null : result.getName();

    // Using the Ambari audit logger, log this event (if enabled)
    if (auditLogger.isEnabled()) {
      AuditEvent loginSucceededAuditEvent = LoginAuditEvent.builder()
          .withRemoteIp(RequestUtils.getRemoteAddress(servletRequest))
          .withUserName(username)
          .withProxyUserName(AuthorizationHelper.getProxyUserName(result))
          .withTimestamp(System.currentTimeMillis())
          .withRoles(permissionHelper.getPermissionLabels(result))
          .build();
      auditLogger.log(loginSucceededAuditEvent);
    }

    // Reset the user's consecutive authentication failure count to 0.
    if (!StringUtils.isEmpty(username)) {
      LOG.debug("Successfully authenticated {}", username);
      users.clearConsecutiveAuthenticationFailures(username);
    } else {
      LOG.warn("Successfully authenticated an unknown user");
    }
  }
PermissionHelper to help create audit entries
ambari-server/src/main/java/org/apache/ambari/server/security/authentication/AmbariAuthenticationEventHandlerImpl.java