title: SBT is unable to find credentials when attempting to download from an Artifactory virtual repo
body: <p>I'm trying to run SBT behind a corporate firewall. Another team has configured an Artifactory proxy. This proxy works fine with anonymous access switched on, but when we make it require a password thinks start to go wrong.</p>
  
  <p>When I run SBT on my workstation I get the following error:</p>
  
  <pre><code>[error] Unable to find credentials for [Artifactory Realm @ coderepo.xxx.amrs.bigco.com]
  </code></pre>
  
  <p>The result of this is that I cannot bootstrap sbt:</p>
  
  <pre><code>[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
  [warn]  ::          UNRESOLVED DEPENDENCIES         ::
  [warn]  ::::::::::::::::::::::::::::::::::::::::::::::
  [warn]  :: org.scala-lang#scala-library;2.10.6: not found
  [warn]  :: org.scala-sbt#sbt;0.13.12: not found
  [warn]  :: org.scala-lang#scala-compiler;2.10.6: not found
  [warn]  ::::::::::::::::::::::::::::::::::::::::::::::
  </code></pre>
  
  <p>I've tried putting a .credentials file in ~/.sbt and also ~/.ivy2: I have been testing variations on the following, all of which do not work:</p>
  
  <pre><code>realm=Artifactory Realm @ coderepo.xxx.amrs.bigco.com
  host=coderepo.xxx.amrs.bigco.com
  user=&lt;username&gt;
  password=&lt;pwd&gt;
  </code></pre>
  
  <p>I'm guessing that this error means that it was unable to locate a credentials definition that matched the realm, so I tried a number of versions of the first line in both locations:</p>
  
  <pre><code>realm=Artifactory Realm
  realm=[Artifactory Realm @ coderepo.xxx.amrs.bigco.com]
  realm=coderepo.xxx.amrs.bigco.com
  </code></pre>
  
  <p>None of which seem to have any impact at all. </p>
  
  <p>So what is the correct way to allow SBT to authenticate with username &amp; password to a password protected Artifactory repository? </p>
  
  <p><strong>UPDATE0</strong>: According to the Ivy documentation, the most likely realm name is simply "Artifactory Realm". According to the SBT documentation, the correct default location of the credentials file should be %USERPROFILE%/.sbt/.credentials (yes, I'm using Windows). Even after deleting the .credentials file in my .ivy2 directory it still doesn't work.</p>
  
  <p><strong>UPDATE1</strong>: Relevant but not actually helpful:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/35497050/sbt-not-passing-credentials-when-publishing-to-artifactory">SBT not passing credentials when publishing to Artifactory</a></li>
  <li><a href="https://stackoverflow.com/questions/28745569/sbt-cant-authorize-in-artifactory">Sbt can&#39;t authorize in Artifactory</a></li>
  </ul>
  
  <p><strong>UPDATE2</strong>: I'm starting to suspect that this is a bug in sbt - I've added an issue here: <a href="https://github.com/sbt/sbt/issues/2817" rel="noreferrer">https://github.com/sbt/sbt/issues/2817</a></p>