code: protected void checkForErrors(Map<String, String[]> parameters) throws AuthenticationException {
          final String errorValues[] = parameters.get("error");
          final String errorReasonValues[] = parameters.get("error_reason");
          final String errorDescriptionValues[] = parameters.get("error_description");
  
          if (errorValues != null && errorValues.length > 0) {
              final String error = errorValues[0];
              final String errorReason = errorReasonValues != null && errorReasonValues.length > 0 ?
                      errorReasonValues[0] : null;
              final String errorDescription = errorDescriptionValues != null && errorDescriptionValues.length > 0 ?
                      errorDescriptionValues[0] : null;
              final String errorText = String.format("An error was returned by the OAuth Provider: error=%s, " +
                      "error_reason=%s, error_description=%s", error, errorReason, errorDescription);
              LOG.info(errorText);
              throw new AuthenticationServiceException(errorText);
          }
      }
docs: Checks to see if an error was returned by the OAuth Provider and throws an {@link AuthenticationException} if
  it was.
  @param parameters Parameters received from the OAuth Provider.
  @throws AuthenticationException If an error was returned by the OAuth Provider.