class_docstr: Base class for the downloaders
class_docstr_tok: ["Base","class","for","the","downloaders"]
docstr: Use when authentication fails to set new credentials for url
  
  Raises
  ------
  DownloadError
    If no known credentials type or user refuses to update
docstr_tok: ["Use","when","authentication","fails","to","set","new","credentials","for","url","Raises","--","--","--","DownloadError","If","no","known","credentials","type","or","user","refuses","to","update"]
code: def _enter_credentials(
      self, url, denied_msg, auth_types=[], new_provider=True
  ):
      """Use when authentication fails to set new credentials for url
  
      Raises
      ------
      DownloadError
        If no known credentials type or user refuses to update
      """
      title = f"{denied_msg} to {url} has failed."
  
      if new_provider:
          # No credential was known, we need to create an
          # appropriate one
          if not ui.yesno(
              title=title,
              text="Would you like to setup a new provider configuration"
              " to access url?",
              default=True,
          ):
              assert not self.authenticator, "bug: incorrect assumption"
              raise DownloadError(
                  title
                  + " No authenticator is known, cannot set any credential"
              )
          else:
              provider = self._setup_new_provider(
                  title, url, auth_types=auth_types
              )
              self.authenticator = provider.authenticator
              self.credential = provider.credential
              if not (self.credential and self.credential.is_known):
                  # TODO: or should we ask to re-enter?
                  self.credential.enter_new()
      else:
          action_msg = (
              "enter other credentials in case they were updated?"
          )
  
          if self.credential and ui.yesno(
              title=title, text="Do you want to %s" % action_msg
          ):
              self.credential.enter_new()
          else:
              raise DownloadError(
                  "Failed to download from %s given available credentials"
                  % url
              )
  
      lgr.debug("set credential context as %s", url)
      self.credential.set_context(auth_url=url)
  
imports: import msgpack
  import os
  import sys
  import time
  from abc import ABCMeta, abstractmethod
  import os.path
  from os.path import exists, join, isdir
  from ..None import cfg
  from ..ui import ui
  from ..utils import auto_repr, ensure_unicode, unlink
  from .credentials import CompositeCredential
  from datalad.downloaders import CREDENTIAL_TYPES
  from ..support.exceptions import AccessDeniedError, AccessPermissionExpiredError, AnonymousAccessDeniedError, CapturedException, DownloadError, IncompleteDownloadError, UnaccountedDownloadError
  from ..support.locking import InterProcessLock, try_lock, try_lock_informatively
  from logging import getLogger
label_desc: Use image node_id 5 for calling the BaseDownloader obj's underlying member method code with example usage: obj._enter_credentials(url, denied_msg, auth_types, new_provider) without return types