Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Authentication-Protected nuget.server

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.

like image 523
Jake Avatar asked Sep 25 '14 20:09

Jake


People also ask

How do I log into a 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.

How do I add NuGet credentials to Visual Studio?

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.

Where are NuGet credentials stored?

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 .


1 Answers

(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).

like image 106
Jake Avatar answered Sep 17 '22 00:09

Jake