How to Diagnose an IIS Authentication Failure

Start with the complete request sequence. Windows authentication can begin with a 401 challenge and then succeed. A single 401 log line does not establish a broken login. Investigate the request that remains unsuccessful after negotiation.

Collect the evidence

Record the exact hostname, URL, authentication method and user identity used in the failed attempt. In browser developer tools, inspect the final status and any WWW-Authenticate challenge. Correlate that request with the IIS log's status, substatus and Win32 status.

On the server, inspect effective configuration without changing it:

PowerShell
$appcmd = Join-Path $env:windir 'System32\inetsrv\appcmd.exe'
$appPath = 'Default Web Site/Demo'
& $appcmd list config $appPath /section:system.webServer/security/authentication/anonymousAuthentication
& $appcmd list config $appPath /section:system.webServer/security/authentication/windowsAuthentication

The expected output identifies which methods are enabled for this path. Compare it with the application's intended access model rather than enabling several methods experimentally.

Test the intended identity

For a Windows-authenticated test endpoint that should accept the current account:

PowerShell
try {
    $response = Invoke-WebRequest 'https://app.example.com/health' -UseDefaultCredentials -ErrorAction Stop
    $response.StatusCode
} catch {
    if ($_.Exception.Response) {
        [int]$_.Exception.Response.StatusCode
    } else {
        throw
    }
}

Replace the URL with the actual endpoint. A successful HTTP response is the first check. Confirm the application's reported user is the expected account. A timeout, DNS failure or certificate error is a different problem and should not be treated as a credential rejection.

Follow the evidence to the owner

Distinguish authentication from application authorization and NTFS access. Check the effective account before reviewing the content directory's ACL. For Kerberos-specific failures, investigate hostname/SPN and delegation requirements against the documented deployment. Do not disable kernel-mode authentication or broaden file permissions as a universal workaround.

Keep the configuration, relevant request trace and identity evidence together. That makes the investigation reproducible when an administrator or application developer needs to follow up.

References

Troubleshoot 4xx and 5xx HTTP Errors in IIS - Internet Information Services
Provides troubleshooting steps for resolving 4xx and 5xx HTTP status code errors in Internet Information Services (IIS).
https://learn.microsoft.com/en-us/troubleshoot/developer/webapps/iis/site-behavior-performance/troubleshoot-http-error-code
Troubleshoot IIS HTTP errors
Troubleshoot Kerberos failures - Internet Information Services
Provides symptoms and various steps you can take to solve them, depending on the scenario.
https://learn.microsoft.com/en-us/troubleshoot/developer/webapps/iis/www-authentication-authorization/troubleshoot-kerberos-failures-ie
Troubleshoot Kerberos failures

Author: Herman Schoenfeld