To make Windows Authentication and single sign-on work locally on your development machine you need to follow a few steps.
Step 1 – Windows Authentication
The first step is to disable all other Authentication methods in IIS, and only enable Windows Authentication. This will prompt you to authenticate yourself but if you try to login you will notice that it only works if you have an “intranet domain”. That is a domain that doesn’t have any periods in it. If your domain is e.g. “myproject.local” you will be declined to login, even if you enter the correct details (step 2 will solve this).
Step 2 – Loopback check
The reason domains with periods doesn’t work is because Windows has a loopback security check that is suppose to prevent “reflection attacks”.
There are two ways you can disable this loopback check. Either disable it altogether or add your domain to a whitelist. The latter being the safe option of course, but could get tiresome if you work with a lot of intranet (and you will probably forget this to next time). For a development machine I therefore recommend disabling it altogether, with the instructions below.
- Open Registry Editor (regedit) and navigate to:
SYSTEM\ CurrentControlSet\ Control\ Lsa
- Add a new DWORD value: "
DisableLoopbackCheck" and set it to "
- You may need to restart your computer.
Step 3 – Single sign-on
By this time you should be able to login to your site and the only part you are missing is single sign-on. This is easily fixed by going into Internet Options (e.g. through Internet Explorer).
- Click the Security tab.
- Choose Local intranet and click the Sites button.
- Click Advanced.
- Add your intranet domain to the list, and then Close>OK>OK your way back.
You should now be able to navigate to your intranet without entering any credentials. This works in Internet Explorer and Google Chrome as far as I have tested.