Authentication-Protected nuget.server
Asked Answered
P

1

16

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.

Pinprick answered 25/9, 2014 at 20:34 Comment(0)
P
7

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

Pinprick answered 25/12, 2014 at 20:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.