How to fix 401 authentication error when publishing on a NuGet self-service server

I followed these instructions to host the NuGet server (version 2.2.2) on our intranet. It works great by listing packages and retrieving them in VS 2012. But when I create a package using Nuget Package Explorer and try to publish it, I am offered a Windows Security dialog box that offers credentials. No matter what credentials I log in, it again asks me for the username and password and returns a 401 authentication error. Why does the NuGet server ask me for Windows credentials and how can I get rid of it? He does this for publication only and nothing more.

+7
source share
4 answers

There is one more thing besides configuring permissions for the Packages folder. In my case, I have to use a URL like

http://<server>/<nuget_virtual_dir>/api/v2/package/ 

to click. This was the only solution in my case.

+3
source

When you use NuGet push, you need to put / api / v 2 / package after the NuGet server URL (example http: // myhost / myNuGetServer / api / v2 / package )

If you are using the NuGet user interface (NuGet Package Explorer), you only need to put the server URL and not the URL (example http: // myhost / myNuGetServer / )

Also follow apikey configuration in Web.config and use it in NuGet push!

+2
source

I think I found a solution (at least for my problems):

I gave up on the Nuget problem and I focused on the ISS 401 error. Then I gave permissions to the user “IIS AppPool \ DefaultAppPool” to the root of the application (or your AppPool, which uses the application, in my case, “ASP.NET v4.0”). Then it works like a charm!

Additional information (and a good explanation of the problem): ApplicationPoolIdentity in IIS7 401 errors

+1
source

You can find this SO answer as it describes how to set up credentials on a publishing workstation (or create a server, but this is accurate information anyway).

0
source

All Articles