static @Nullable Credentials getCredentials(@NotNull JBCefBrowserBase browser, @NotNull String proxyServer, int proxyPort) {
    final Ref<Credentials> credentials = new Ref<>();
    JBCefProxySettings proxySettings = JBCefProxySettings.getInstance();
    String proxyHost = StringUtil.trimTrailing(ObjectUtils.notNull(proxySettings.PROXY_HOST, ""), '/');
    proxyServer = StringUtil.trimTrailing(proxyServer, '/');

    if (proxySettings.PROXY_AUTHENTICATION && proxyServer.equals(proxyHost) && proxySettings.PROXY_PORT == proxyPort) {
      // first try credentials from the settings
      credentials.set(new Credentials(proxySettings.getProxyLogin(), proxySettings.getPlainProxyPassword()));
      if (credentials.get().getUserName() != null && credentials.get().getPassword() != null) {
        return credentials.get();
      }
    }
    // then ask the user for credentials
    if (!GraphicsEnvironment.isHeadless()) {
      String proxy = proxyServer + ":" + proxyPort;
      Runnable runnable = () -> {
        // 3) finally ask the user for credentials
        DataContext dataContext = DataManager.getInstance().getDataContext(browser.getCefBrowser().getUIComponent());
        MyLoginDialog dialog = new MyLoginDialog(CommonDataKeys.PROJECT.getData(dataContext), proxy, proxySettings.getProxyLogin());
        dialog.show();
        credentials.set(dialog.getCredentials());
      };
      if (EventQueue.isDispatchThread()) {
        runnable.run();
      }
      else {
        try {
          EventQueue.invokeAndWait(runnable);
        }
        catch (Throwable e) {
          Logger.getInstance(JBCefProxyAuthenticator.class).error(e);
        }
      }
    }
    return credentials.get();
  }
static @Nullable Credentials getCredentials(@NotNull JBCefBrowserBase browser, @NotNull String proxyServer, int proxyPort)