# 401 Unauthorized in IIS

> Read the IIS 401 sub-status (401.1 to 401.5, 401.501 to 401.504) and fix the cause: authentication methods, NTFS ACLs, filters, IP restrictions.

Canonical: https://scaplet.com/errors/http/401/iis

Guide Error · HTTP status codes

Read the IIS 401 sub-status (401.1 to 401.5, 401.501 to 401.504) and fix the cause: authentication methods, NTFS ACLs, filters, IP restrictions.

3 min

read

5

sources

Oct 29, 2026

updated

Scaplet Editorial Team

author

401 4xx · Client error

The short answer

IIS splits 401 into sub-status codes. 401.1 is a failed logon, 401.2 a server authentication configuration problem, 401.3 an NTFS ACL denial, 401.4 and 401.5 an ISAPI filter or CGI application, and 401.501 to 401.504 the IP restriction features. The sub-status tells you which fix applies.

1. [Read the sub-status before changing anything](#read-the-sub-status-before-changing-anything)
2. [Authentication methods: the usual 401.2](#authentication-methods-the-usual-401-2)
3. [Reproduce and check it in 2 minutes](#reproduce-and-check-it-in-2-minutes)
4. [Windows authentication specifics](#windows-authentication-specifics)
5. [What it means for SEO and crawlers](#what-it-means-for-seo-and-crawlers)

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F401%2Fiis%20(%22401%20Unauthorized%20in%20IIS%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F401%2Fiis%20(%22401%20Unauthorized%20in%20IIS%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F401%2Fiis%20(%22401%20Unauthorized%20in%20IIS%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F401%2Fiis%20(%22401%20Unauthorized%20in%20IIS%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

_01_Explained

## Read the sub-status before changing anything

Microsoft's IIS [status code](/glossary/http-status-codes) reference lists the following 401 sub-status codes. One 401 can mean a wrong password, a missing authentication module or a file permission, and the sub-status is the quickest way to tell them apart.

IIS 401 sub-status codes and first thing to check
| Code | Microsoft's label | First check |
| 401.1 | Logon failed | User name or password; whether the account exists |
| 401.2 | Logon failed due to server configuration | Authentication settings: is any enabled method one the client can use? |
| 401.3 | Unauthorized due to ACL on resource | NTFS permissions on the file and its folder |
| 401.4 | Authorization failed by filter | ISAPI filters installed on the site |
| 401.5 | Authorization failed by ISAPI/CGI application | The ISAPI or CGI application's own authorization |
| 401.501 | Concurrent request [rate limit](/glossary/rate-limiting) reached | Dynamic IP Restriction concurrent-request setting |
| 401.502 | Maximum request rate limit reached | Dynamic IP Restriction request-rate setting |
| 401.503 | IP address denied | IP Restriction deny list |
| 401.504 | Host name denied | IP Restriction deny list by host name |

The reference says these specific codes are displayed in the client browser but not in the IIS log. By default IIS shows detailed error information only to a browser on the local server and a generic message to everyone else, because `errorMode` defaults to `DetailedLocalOnly`. So request the page from the server itself to see the sub-status, or set `errorMode` to `Detailed` temporarily while debugging.

_02_Check it

## Authentication methods: the usual 401.2

IIS supports Anonymous, Basic, Client Certificate Mapping, Digest, IIS Client Certificate Mapping and Windows authentication. A method has to be both installed and enabled for the site. For Windows authentication, the docs say the default install of IIS 7 and later does not include the role service, and that you must disable Anonymous authentication and enable Windows authentication for the site.

The same change from the command line, which Microsoft's page shows with `/commit:apphost`:

appcmd: disable Anonymous, enable Windows authentication

```
appcmd.exe set config "Contoso" -section:system.webServer/security/authentication/anonymousAuthentication /enabled:"False" /commit:apphost appcmd.exe set config "Contoso" -section:system.webServer/security/authentication/windowsAuthentication /enabled:"True" /commit:apphost
```

**A 401 with a challenge is normal**With Anonymous disabled, the first request to a protected URL gets a 401 carrying the authentication challenge, and an authenticating client then retries with credentials. Only count a 401 as a fault when the authenticated retry also fails.

Web.config or ApplicationHost.config: Basic and Windows on, Anonymous off

```
<location path="Contoso"> <system.webServer> <security> <authentication> <anonymousAuthentication enabled="false" /> <basicAuthentication enabled="true" defaultLogonDomain="Contoso" /> <windowsAuthentication enabled="true" /> </authentication> </security> </system.webServer> </location>
```

_03_Fix it on your stack

## Reproduce and check it in 2 minutes

A public endpoint shows what the challenge looks like. This one uses Basic, so the header names the scheme and a realm:

Public endpoint: see the 401 and its challenge header
Public endpoint: see the 401 and its challenge header

```
curl -s -D - -o /dev/null https://httpbin.org/status/401 # Expect: HTTP/2 401 and a www-authenticate: Basic realm="Fake Realm" header
```

Your own IIS site: which authentication schemes does it offer?
Your own IIS site: which authentication schemes does it offer?

```
curl -s -D - -o /dev/null https://intranet.example.test/ | grep -i www-authenticate # With Windows authentication on, the default provider list from the docs is # Negotiate then NTLM, so expect those schemes in the header.
```

Same site, sending your Windows credentials
Same site, sending your Windows credentials

```
Invoke-WebRequest -Uri https://intranet.example.test/ -UseDefaultCredentials | Select-Object StatusCode # Expect: 200. A 401.1 here points at the account, a 401.3 at NTFS permissions.
```

On your own IIS site, the challenge header tells you which methods are enabled. This needs your host name:

_04_Check it

## Windows authentication specifics

Windows authentication supports Kerberos and NTLM, and the default provider order in ApplicationHost.config is `Negotiate` then `NTLM`. The docs say it suits intranets because Kerberos needs a connection to Active Directory and NTLM does not work through HTTP proxy connections.

`useKernelMode` defaults to `true`. Microsoft's best practice is to leave it on if you use Kerberos with a custom application pool identity, since kernel-mode authentication can prevent authentication problems with such pools. If a Kerberos login works for the default identity and fails for a custom one, check that setting before touching SPNs.

Default Windows authentication providers from the docs

```
<windowsAuthentication enabled="false"> <providers> <add value="Negotiate" /> <add value="NTLM" /> </providers> </windowsAuthentication>
```

_05_Explained

## What it means for SEO and crawlers

Google's documentation says it does not index URLs that return 4xx and that you should not use 401 or 403 to limit crawling. A site that returns 401 to everyone, including crawlers, will not have those pages indexed. That is correct for an intranet and wrong for a public page. If a public IIS page shows 401 to anonymous visitors, check whether Anonymous authentication is on at that path. For the sibling errors see [403 in IIS](/errors/http/403/iis) and [404 in IIS](/errors/http/404/iis).

Sources · 5

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- microsoft.com
- google.com

1. 01 [HTTP status code overview - Internet Information Services (Microsoft Learn)](https://learn.microsoft.com/en-us/troubleshoot/developer/webapps/iis/health-diagnostic-performance/http-status-code) learn.microsoft.com · checked 2026-11-01
2. 02 [Security Authentication <authentication> (Microsoft Learn)](https://learn.microsoft.com/en-us/iis/configuration/system.webserver/security/authentication/) learn.microsoft.com · checked 2026-11-01
3. 03 [Windows Authentication <windowsAuthentication> (Microsoft Learn)](https://learn.microsoft.com/en-us/iis/configuration/system.webserver/security/authentication/windowsauthentication/) learn.microsoft.com · checked 2026-11-01
4. 04 [HTTP Errors <httpErrors> (Microsoft Learn)](https://learn.microsoft.com/en-us/iis/configuration/system.webserver/httperrors/) learn.microsoft.com · checked 2026-11-01
5. 05 [How HTTP status codes affect Google's crawlers](https://developers.google.com/search/docs/crawling-indexing/http-network-errors) developers.google.com · checked 2026-11-01

Questions

## Asked a lot.

2 questions people ask next, answered from the sources on this page.

_01_ What is the difference between 401.1 and 401.3 in IIS?

401.1 means the logon failed, probably a bad user name or password. 401.3 means NTFS permissions on the resource denied an identity that did log on.

_02_ Why do I see a 401 once before the login succeeds?

The first request carries no credentials, so IIS answers with a 401 and the authentication challenge. The client then retries with credentials.

## Keep learning

[All errors](/errors)

[Learn HTTP 401 Unauthorized HTTP status codes](/errors/http/401) [Related 4xx errors Status codes and links](/seo-issues/4xx-errors) [Read next 403 Forbidden in IIS HTTP status codes](/errors/http/403/iis) [Do Run a free site audit Free, about two minutes](/site-audit)

Other 401 errors
[401 Unauthorized in Laravel](/errors/http/401/laravel) [401 Unauthorized in Spring Boot](/errors/http/401/spring-boot) [401 Unauthorized in the WordPress REST API](/errors/http/401/wordpress) [HTTP 401 Unauthorized](/errors/http/401)

Nearby in errors
[400 Bad Request in Spring Boot](/errors/http/400/spring-boot)

More in HTTP 401 Unauthorized
[401 Unauthorized in IIS](/errors/http/401/iis) [401 Unauthorized in Laravel](/errors/http/401/laravel) [401 Unauthorized in Spring Boot](/errors/http/401/spring-boot) [401 Unauthorized in the WordPress REST API](/errors/http/401/wordpress)

Terms on this page
[HTTP status codes](/glossary/http-status-codes) [Rate limiting](/glossary/rate-limiting)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
