title: How do I list all of my Jenkins credentials in the script console?
body: <p>I'm trying to get Jenkins to clone my mercurial project from BitBucket. It won't, because it <em>says</em> there's a problem with the credentials - well, bitbucket is refusing whatever it is that Jenkins is providing.</p>
  
  <p>I'm almost 100% sure that Jenkins is not providing what it should be providing, because when I run</p>
  
  <pre><code>hg clone --ssh="ssh -i /path/to/my/key" ssh://hg@bitbucket.org/my-org/my-repo
  </code></pre>
  
  <p>It clones a-OK. The contents of <code>/path/to/my/key</code> are what I put in the key in Jenkins' credentials manager. I've verified that it is found in my jenkins <code>credentials.xml</code> file.</p>
  
  <p>And <em>yet</em>, when I try to run my job? Clone fails because </p>
  
  <pre><code>remote: Host key verification failed.
  </code></pre>
  
  <p>That leads me to believe that the problem is with whatever is getting passed via the mercurial plugin. But I can't see it in the log because it's some sort of <a href="https://github.com/jenkinsci/mercurial-plugin/blob/17a01f2097e3a90568b42705c9a0d223695bdef5/src/main/java/hudson/plugins/mercurial/HgExe.java#L155" rel="noreferrer">masked string</a> and just displays as <code>******</code>.</p>
  
  <p>So I wanted to make sure that the credentials that are going to the Hg plugin are, in fact, what's present in my <code>credentials.xml</code> file.</p>
  
  <p>So far I've made it to here:</p>
  
  <pre><code>import com.cloudbees.plugins.credentials.CredentialsProvider
  import com.cloudbees.plugins.credentials.common.StandardUsernameCredentials
  
  
  def creds = CredentialsProvider.all()
  print creds
  </code></pre>
  
  <p>Which gives me a list of credentials providers... but I'm not sure where to go next. I've been drowning in documentation trying to figure out how to get at the credential information that I want... but no dice.</p>
  
  <p>(How) can I take what I've got and display a list of my Jenkins credentials in the Groovy script console?</p>