Home
Atom Feed

Windows always prompting for password when using Basic Authentication

I first encountered the above problem when working with SharePoint, but recently got the same problem with MyGet private feeds.

I've heard a lot of other people also has encountered this problem, so I decided to post a solution here and hopefully help some of them.

The problem boils down to the fact that Windows (from Vista and upwards) uses the Web Client service to connect to web resources. It is also worth noting that Microsoft has been aware of this problem since Vista but has not made a permanent fix yet.

If you open your "Credential Manager" in the Control Panel on your computer, you will se an entry for the myget webpage if you tried to log in once via Visual Studio and checking "Remember password".

The problem is that Windows does not use these credentials unless it trusts the server.

To solve this problem, you need to edit the Windows Registry on your computer, so be careful what you do. I cannot take responsibility if you mess up anything in there.

First, open the registry editor by pressing the windows start button and then writing "regedit" and then press the enter key:

Then browse to the following folder: "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\WebClient\Parameters"

Double-click on the AuthForwardServerList item:

 

As you can see, I've added "http://www.myget.org/* to the list.
That means that Windows will now automatically forward stored authentication to all requests for that adress.

You can add more addresses here by putting them on a new line. This also works with your SharePoint servers, both with accessing it via the web browser or mapping a document library as a disk (WebDAV).