@Override
  public void loginSuccess(HttpRequest request, @Nullable String login, Source source) {
    checkRequest(request);
    requireNonNull(source, "source can't be null");
    LOGGER.atDebug().setMessage("login success [method|{}][provider|{}|{}][IP|{}|{}][login|{}]")
      .addArgument(source::getMethod)
      .addArgument(source::getProvider)
      .addArgument(source::getProviderName)
      .addArgument(request::getRemoteAddr)
      .addArgument(() -> getAllIps(request))
      .addArgument(() -> preventLogFlood(sanitizeLog(emptyIfNull(login))))
      .log();
  }
@Test
  public void login_success_logs_X_Forwarded_For_header_from_request() {
    HttpRequest request = mockRequest("1.2.3.4", List.of("2.3.4.5"));
    underTest.loginSuccess(request, "foo", Source.realm(Method.EXTERNAL, "bar"));

    verifyLog("login success [method|EXTERNAL][provider|REALM|bar][IP|1.2.3.4|2.3.4.5][login|foo]", Set.of("logout", "login failure"));
  }