I am trying to setup an instance of nuget.server which is password protected not only for pushing packages, but also for pulling/downloading packages.
I did not see a way to do this with nuget by default, so I password protected the folder in which the nuget.server is installed with IIS (authentication based on Windows login).
I am now able to access the packages with Visual Studio (2012) which prompts for my password; however, when I try to push, I get an Internal Server Error (500). It does not ask for my authentication information.
Is it possible to protect my nuget.server this way? If so, what have I done wrong? Also, I would appreciate suggestions of a better way to authenticate the getting of packages with nuget.server.
Open Visual Studio and navigate to the NuGet Package Manager, click on "Fabrikam Feed". You should be prompted for credentials. You can enter credentials here and tick the save/remember options.
Open Visual Studio. Go to Tools > NuGet Package Manager > Package Manager Settings, select Package Manager Sources and click the + button. Choose the feed Name and set the feed URL to https://nuget.telerik.com/v3/index.json. Click OK.
Globally: to make a credential provider available to all instances of nuget.exe run under the current user's profile, add it to %LocalAppData%\NuGet\CredentialProviders .
(After coming to this problem again, I have solved it)
In newer versions of nuget server, it is possible to include credentials. You will need to first add the account with something like the line below. The storing password in clear text is optional.
nuget sources add –Name <feedname> -User <username> -Password <password> -ConfigFile nuget.config -StorePasswordInClearText
Then, you should be able to access and download packages from this server which is authentication protected as normal.
Note that by default, the line above will add to the nuget configuration file for a specific user account. You will need to run that as the user which is running it. (In my case, my build server was on a different user account than my terminal which caused some problems).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With