Nuget plugin authorization fails

Topics: General
Dec 26, 2014 at 5:37 PM
Hi guys!
I have a problem with private source. I have deployed nuget server and turned on basic auth in IIS. When I open http://myserver/nuget/Packages in browser, it asks for username/password, then I type them and auth passes.
I have created nuget.config file and put it to the solution's root:
<?xml version="1.0" encoding="utf-8"?>
<config>
  <activePackageSource>
    <add key="All" value="(Aggregate source)" />
  </activePackageSource>
  <packageSources>
    <add key="MySource" value="http://MySource.com/nuget" />
  </packageSources>
  <disabledPackageSources />
  <packageSourceCredentials>
    <MySource>
      <add key="Username" value="NugetUser" />
      <add key="ClearTextPassword" value="MySourceClearPassword" />
    </MySource>
  </packageSourceCredentials>
</config>
So, I can see MySource in drop down list Package sources in Package Manager Console window. But when I'm trying to install/restore package Visual Studio (2013 Community upd4, nuget 2.8.50926.663) asks for credentials... I have looked through wireshark, no auth header in outgoing packets are set, only User-Agent: Nuget... I have tried on VS 2013 Express for web upd3 with the same results.
What am I doing wrong?
Dec 29, 2014 at 3:32 PM
Hello again :)
I have configured pushing but it looks silly. Push command sees credentials, but push url has to point to the root path of published nuget server (without /nuget). Also to prevent showing fictive source and do not querying it for packages I have added it to the disabledPackageSources section and even after that push command completes successfully, so it use credentials of disabled source. But install/restore package still asks for credentials.
Please, help me to solve this.
<?xml version="1.0" encoding="utf-8"?>
<config>
  <activePackageSource>
    <add key="All" value="(Aggregate source)" />
  </activePackageSource>
  <packageSources>
    <add key="MySource" value="http://MySource.com/nuget" />
    <add key="MySourcePush" value="http://MySource.com/" />
  </packageSources>
  <disabledPackageSources>
    <add key="MySourcePush" />
  </disabledPackageSources>
  <packageSourceCredentials>
    <MySource>
      <add key="Username" value="NugetUser" />
      <add key="ClearTextPassword" value="MySourceClearPassword" />
    </MySource>
    <MySourcePush>
      <add key="Username" value="NugetUser" />
      <add key="ClearTextPassword" value="MySourceClearPassword" />
    </MySourcePush>
  </packageSourceCredentials>
</config>