code: protected String constructLoginURL(HttpServletRequest request, boolean isXMLRequest) {
          String delimiter = "?";
          if (authenticationProviderUrl.contains("?")) {
              delimiter = "&";
          }
          StringBuilder loginURL = new StringBuilder();
          if (isXMLRequest) {
              String atlasApplicationURL = "";
              String referalURL = request.getHeader("referer");
  
              if (referalURL == null) {
                  atlasApplicationURL = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();
              } else {
                  atlasApplicationURL = referalURL;
              }
  
              loginURL.append(authenticationProviderUrl).append(delimiter).append(originalUrlQueryParam).append("=").append(atlasApplicationURL);
          } else {
              loginURL.append(authenticationProviderUrl).append(delimiter).append(originalUrlQueryParam).append("=").append(request.getRequestURL().append(getOriginalQueryString(request)));
          }
          return loginURL.toString();
      }
docs: Create the URL to be used for authentication of the user in the absence
  of a JWT token within the incoming request.
  
  @param request for getting the original request URL
  @return url to use as login url for redirect