@Override
  public AuthVerifierResult.State verifyRequest() throws PortalException {
    AccessControlContext accessControlContext = AccessControlUtil.getAccessControlContext();

    AuthVerifierResult authVerifierResult =
        AuthVerifierPipeline.verifyRequest(accessControlContext);

    Map<String, Object> authVerifierResultSettings = authVerifierResult.getSettings();

    if (authVerifierResultSettings != null) {
      Map<String, Object> settings = accessControlContext.getSettings();

      settings.putAll(authVerifierResultSettings);
    }

    accessControlContext.setAuthVerifierResult(authVerifierResult);

    return authVerifierResult.getState();
  }
  @Override
  public void initAccessControlContext(
      HttpServletRequest request, HttpServletResponse response, Map<String, Object> settings) {

    AccessControlContext accessControlContext = AccessControlUtil.getAccessControlContext();

    if (accessControlContext != null) {
      throw new IllegalStateException("Authentication context is already initialized");
    }

    accessControlContext = new AccessControlContext();

    accessControlContext.setRequest(request);
    accessControlContext.setResponse(response);

    Map<String, Object> accessControlContextSettings = accessControlContext.getSettings();

    accessControlContextSettings.putAll(settings);

    AccessControlUtil.setAccessControlContext(accessControlContext);
  }