@Override
  public boolean preHandle(final HttpServletRequest request, final HttpServletResponse response,
      final Object handler) throws Exception {
    final Map<String, String> requestParameterValues = new HashMap<>();

    for (Enumeration<String> requestParameters = request.getParameterNames(); requestParameters
        .hasMoreElements();) {
      final String requestParameter = requestParameters.nextElement();
      if (requestParameter.startsWith(ENVIRONMENT_VARIABLE_REQUEST_PARAMETER_PREFIX)) {
        String requestValue = request.getParameter(requestParameter);
        requestParameterValues.put(
            requestParameter.substring(ENVIRONMENT_VARIABLE_REQUEST_PARAMETER_PREFIX.length()),
            requestValue);
      }
    }

    ENV.set(requestParameterValues);

    String token = request.getHeader(ResourceConstants.TOKEN);
    String username = request.getHeader(ResourceConstants.USER_NAME);
    String password = request.getHeader(ResourceConstants.PASSWORD);
    Properties credentials = new Properties();
    if (token != null) {
      credentials.put(ResourceConstants.TOKEN, token);
    } else {
      if (username != null) {
        credentials.put(ResourceConstants.USER_NAME, username);
      }
      if (password != null) {
        credentials.put(ResourceConstants.PASSWORD, password);
      }
    }
    securityService.login(credentials);

    return true;
  }
The GetEnvironmentHandlerInterceptor class handles extracting Gfsh environment variables encoded
in the HTTP request message as request parameters.
<p>

@see javax.servlet.http.HttpServletRequest
@see javax.servlet.http.HttpServletResponse
@see org.springframework.web.servlet.AsyncHandlerInterceptor
@since GemFire 8.0
geode-web/src/main/java/org/apache/geode/management/internal/web/controllers/support/LoginHandlerInterceptor.java