Skip to content

Est. 2011ยทMicrosoft Partner ID 7033487ยทDelivery under 3 minยทSupport 7 days a week

Your vault is empty.

Free Fix HTTP 401.1

HTTP 401.1, 401.2 and 401.3: IIS keeps rejecting perfectly valid logons

11 min read Updated October 5, 2026 Windows Server: RDS, Hyper-V & Clustering

Fix it now

A 401 from IIS is three different failures wearing one status code, and the sub-status separates them. Microsoft publishes 401.1 as a failed logon, 401.2 as a logon that failed because of server configuration, and 401.3 as unauthorized due to the ACL on the resource. Until you know which one you have, every change is a guess.

Run these in an elevated Command Prompt on the web server

%windir%\system32\inetsrv\appcmd list config "Default Web Site/" /section:system.webServer/security/authentication
setspn -L <account the pool runs as>
setspn -X
  1. Open the IIS log for the site and read sc-status and sc-substatus together on the failing request. The sub-status is the diagnosis; the rest of this is confirmation.
  2. For 401.3, grant Read on the content folder to the identity that actually authenticated: the anonymous user for anonymous requests, the caller for Windows-authenticated ones, or the application pool identity where the site is set to use it.
  3. For 401.2, check which authentication methods are enabled on the site in IIS Manager under Authentication, and confirm the role service for the one you need is installed.
  4. For 401.1, test the same account interactively on another machine to rule out a wrong password, a lockout, an expired password or a disabled account.
  5. If it works on the server console and fails from every client, look at Kerberos: setspn -L on the pool account, then setspn -X for duplicates across the domain.

The first 401 on a Windows-authenticated request is normal. It is the challenge. Look at the last status on the connection, not the first.

If the site now serves the page without prompting, you can stop here. If it still prompts, the next section explains which side of the handshake is failing.

Why it happens

Authentication in IIS is a negotiation. The first request arrives with no credentials, IIS answers 401 with a list of the schemes it accepts, and the client picks one and tries again. That first 401 appears in the log on every successful Windows-authenticated request. The one worth investigating is the last one, where the client had nothing left to try.

401.1 and 401.2 fail on opposite sides of that exchange. Microsoft publishes 401.1 as “Logon failed”: a credential reached the local security authority and was refused, so you are looking at the account rather than at IIS. 401.2 is published as “Logon failed due to server configuration”: the negotiation never got that far, because the client could not use any scheme the site offered, or the scheme it needed was disabled, or anonymous is off and nothing else is on.

401.3 is a different layer entirely. Microsoft publishes it as “Unauthorized due to ACL on resource”. Authentication succeeded, IIS tried to open the file as the resulting identity, and the file system said no. Which identity that is depends on how the request authenticated, and that is the part people get wrong: the anonymous account for anonymous requests, the caller for Windows-authenticated ones, or the pool identity where the site is configured to use it.

Anonymous authentication is enabled and quietly winning

You have this one if The application behaves as though nobody is signed in, or a 401.3 names an identity you did not expect.

  1. In IIS Manager select the site, open Authentication, and read which methods show as Enabled.
  2. Disable Anonymous Authentication if the site is meant to identify its users.
  3. If anonymous must stay on, open its settings and decide deliberately whether it runs as a specific user or as the application pool identity.
  4. Grant Read on the content to whichever identity you chose, then retry.

Anonymous and Windows authentication coexist happily, and anonymous is tried first. Leaving both on is the most common reason a site never sees a real user name.

The ACL does not include the identity that authenticated

You have this one if A 401.3, and the folder’s Security tab has no entry covering the caller, the anonymous account or the pool.

  1. Work out which identity is in play from the site’s Authentication settings before you touch permissions.
  2. Grant Read, and only Read, on the content directory to that identity.
  3. For an application pool identity, use the IIS AppPool\<poolname> form. It is a real security principal even though it never appears in Active Directory.
  4. If content is on a share, both the share permissions and the NTFS permissions have to allow the read.

Do not grant Everyone. It hides which identity is really being used, and the next time this happens you will have removed the only evidence.

Kerberos cannot identify the service

You have this one if Authentication works from the server console and fails from every client, or works over NTLM and fails as soon as Kerberos is used.

  1. List the service principal names on the account the pool runs as: setspn -L <account>
  2. Search the domain for duplicates: setspn -X. A duplicate breaks Kerberos for every service that shares it.
  3. Register the missing name against the correct account with setspn -S, which checks for duplicates before it writes.
  4. If kernel-mode authentication is on and the pool runs as a domain account, either set the site to use the pool credentials for kernel-mode authentication, or register the name against the machine account instead.

Microsoft documents setspn -S rather than -A precisely because it refuses to create a duplicate. Use it.

The next fix edits the registry. Export the key first. The loopback check exists to block a real class of relay attack, and Microsoft states that disabling it outright reduces security and opens the server to NTLM man-in-the-middle attacks.

The loopback check rejects name-based requests on the server itself

You have this one if Browsing the site on the server works by machine name and fails with a DNS alias or a load balancer name. Remote clients are fine. You get repeated logon prompts, an access denied message, or “No network provider accepted the given network path”.

  1. Add the names clients use to the multi-string value BackConnectionHostNames under HKLM\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0, one host name per line.
  2. If a value of that name already exists as a REG_DWORD, delete it first. Microsoft documents that step explicitly.
  3. Restart the server so the new list is read, then re-test using the alias from the console.

There is a blanket switch, DisableLoopbackCheck under the Lsa key. Microsoft documents it as the second method and warns about it. Prefer the host-name list.

Full reference

The five sub-statuses, as Microsoft publishes them

Sub-status Published meaning What that makes it
401.1 Logon failed An account problem: password, lockout, expiry, or an account the server does not trust
401.2 Logon failed due to server configuration A negotiation problem: the client and the site have no scheme in common
401.3 Unauthorized due to ACL on resource A file system problem, after authentication already succeeded
401.4 Authorization failed by filter A filter in the pipeline made the decision
401.5 Authorization failed by ISAPI/CGI application An ISAPI or CGI application made the decision

Working out which identity a request is running as

This is the single most useful habit for 401.3, because the answer is not always the one on the login page.

  1. Open the site’s Authentication settings in IIS Manager and note every method that is Enabled.
  2. If Anonymous is enabled, open its settings. It runs either as a named account or as the application pool identity, and that choice decides which ACL matters.
  3. If Windows Authentication is enabled and anonymous is not, the identity is the caller.
  4. If the application impersonates, or the pool is configured to run as a specific domain account, that account is the one to check against the folder.
  5. Grant Read to whichever identity that turned out to be, and re-test with a second account in a different group so you know you fixed the model rather than one user.

The two loopback registry values

Value Path Type What Microsoft says
BackConnectionHostNames HKLM\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0 REG_MULTI_SZ The recommended method. One CNAME or DNS alias per line
DisableLoopbackCheck HKLM\SYSTEM\CurrentControlSet\Control\Lsa DWORD Set to 1 it turns the check off entirely. Documented, with the warning that it reduces security and opens the server to NTLM man-in-the-middle attacks

If BackConnectionHostNames already exists as a REG_DWORD rather than a multi-string, delete it before creating the correct one. Microsoft calls that out because it is a common leftover and the value is silently ignored in the wrong type.

Service principal names, in the order that saves time

Command What Microsoft publishes it as
setspn -L <account> Lists the currently registered SPNs for the computer or account
setspn -X Performs a search for duplicate SPNs
setspn -Q <spn> Queries for any existing SPNs
setspn -S <spn> <account> Adds the SPN after verifying that no duplicates exist

Microsoft documents -S and mentions -A only to say you should use -S instead, because it checks for duplicates first. A duplicate SPN breaks Kerberos for both holders, not only the one you are troubleshooting, so removing the wrong registration is the fix rather than adding another.

Where to look when the sub-status does not settle it

  • Read the last status on the connection. A 401 followed by a 200 is a successful Windows-authenticated request and nothing is wrong.
  • Test from the console and from a workstation and compare. The difference between them is itself the clue, and it usually points at Kerberos or at the loopback check.
  • For a 401.4 or 401.5, identify the filter or ISAPI application in the pipeline and take the question to whoever owns it. IIS is reporting somebody else’s decision.
  • Check whether the site is behind something that terminates the connection first. A load balancer or reverse proxy changes which name the client presents, which is exactly what the loopback check reacts to.

Every code this article covers

Code What it points at Source
HTTP 401.1 Logon failed: credentials were supplied and the logon attempt was refused Microsoft Learn
HTTP 401.2 Logon failed due to server configuration: no authentication method was available that both the client and the site could use Microsoft Learn
HTTP 401.3 Unauthorized due to ACL on resource: authentication succeeded and the access control list on the content denied the read Microsoft Learn
HTTP 401.4 Authorization failed by filter: a filter in the request pipeline rejected the request Microsoft Learn
HTTP 401.5 Authorization failed by ISAPI/CGI application: the component made the decision, not IIS Microsoft Learn

Confirm the fix worked

  1. Request the protected URL from a client workstation and confirm it returns content without prompting repeatedly.
  2. Check the IIS log for that request and confirm the final entry is a 200 with sc-substatus 0.
  3. Confirm the application reports the expected user name rather than the anonymous account.
  4. Test with a second account in a different group, so you know the permission model is right rather than one entry.
  5. If you edited the Lsa keys, restart the server and re-test by alias, because the list is read at startup.

Questions people ask about this

Is any of this a licensing problem?

No. These are authentication settings, file system permissions and directory configuration. Everything you need is already on the server.

Why do I see a 401 in the log on requests that clearly worked?

Because the first 401 is the challenge. The client sends an unauthenticated request, gets challenged, and retries with credentials. Read the last status on the connection, not the first.

Should I just give Everyone read access to fix a 401.3?

No. It masks which identity is really being used and publishes content you may not intend to. Microsoft’s published meaning for 401.3 is the ACL on the resource, so identify the account from the Authentication settings and grant Read to that one.

Why does it work on the server but not from a workstation?

That pattern is usually Kerberos. From the console the request can fall back to a local logon; from a workstation it needs a correctly registered service principal name on the account the pool runs as. Check setspn -L and then setspn -X.

Is BackConnectionHostNames or DisableLoopbackCheck the right answer?

BackConnectionHostNames. Microsoft marks it as the recommended method and attaches the security warning to the other one: disabling the loopback check entirely opens the server to NTLM man-in-the-middle attacks.

Related error codes

Was this article helpful?

Your feedback helps us improve our documentation.

Related articles

Free Fix Event ID 4625 with 0xC000015B: users lack the right to log on through RDS License Error Event ID 1004: the RD Session Host cannot issue a client access licence Free Fix 0x807800C5 and Event ID 521: Windows Server Backup dies at the snapshot License Error Event ID 129 and 153: iSCSI and SAN timeouts retry until the volume drops
โ† Back to Knowledge Base