code: protected void error(HttpServletRequest httpRequest, HttpServletResponse httpResponse, String authnEventId)
        throws ExternalAuthenticationException, IOException {
  
      final String key = this.getExternalAuthenticationKey(httpRequest);
      httpRequest.setAttribute(ExternalAuthentication.AUTHENTICATION_ERROR_KEY, authnEventId);
      ExternalAuthentication.finishExternalAuthentication(key, httpRequest, httpResponse);
      httpRequest.getSession().removeAttribute(EXTAUTHN_KEY_ATTRIBUTE_NAME);
    }
docs: Method that should be invoked to exit the external authentication process with an error.
  
  @param httpRequest
  the HTTP request
  @param httpResponse
  the HTTP response
  @param authnEventId
  the Shibboleth event ID to signal
  @throws ExternalAuthenticationException
  for Shibboleth session errors
  @throws IOException
  for IO errors
  @see #error(HttpServletRequest, HttpServletResponse, Exception)
  @see #error(HttpServletRequest, HttpServletResponse, Status)