HTTP Error 401.1 – Unauthorized bei Verwendung von Windows Authentication

Kurz und knackig:

Windows Authentication + Host Name = http 401 error

if (host name != computername && server != Domain Member)

Lösung: Host Name in Registry Eintragen -> MS KB Article 896861 - Detais s.u.

 

Scenario:

Webserver IIS7.x – keine Domäne – Server ist Bestandteil einer Workgroup.

Website -> Authentication -> Windows Authentication enabled

Authorization Rule „allow all“ entfernt und Allow Eintrag für Specific user „Administrator“ gemacht. (Alternativ: Website -> Authentication -> Anonymous Authentication deaktivieren)

Problem:

Beim Browsen auf die Seite bekomme ich ein Passwort Prompt (ok.) Nach Eingabe von Benutzername und Passwort werde ich noch 2mal aufgefordert Username und Passwort (böse) einzugeben – letztendlich schlägt der Zugriff fehl und das obwohl der user (in meinem Fall administrator) 100%ig Zugriff haben sollte.

browser password prompt leads to access denied 401.1

 

HTTP Error 401.1 – Unauthorized

You do not have permission to view this directory or page using the credentials that you supplied. Detailed Error Information

Module WindowsAuthenticationModule

Notification AuthenticateRequest

Handler PageHandlerFactory-Integrated

Error Code 0xc000006d

Logon Method Not yet determined

Logon User Not yet determined

 

Eventlog zeigt Audit Failure bei Logon mit Status 0xc000006d:

Eventlog showing Audit Logon Failure

An account failed to log on.

Subject:

       Security ID: NULL SID

       Account Name: -

       Account Domain: -

       Logon ID: 0x0

Logon Type: 3

Account For Which Logon Failed:

       Security ID: NULL SID

       Account Name: administrator

       Account Domain: TEST-UXANGUNQ4J

Failure Information:

       Failure Reason: An Error occured during Logon.

       Status: 0xc000006d

       Sub Status: 0x0

Process Information:

       Caller Process ID: 0x0

       Caller Process Name: -

Network Information:

       Workstation Name: TEST-UXANGUNQ4J

       Source Network Address: 127.0.0.1

       Source Port: 58948

Detailed Authentication Information:

       Logon Process:

       Authentication Package: NTLM

       Transited Services: -

       Package Name (NTLM only): -

       Key Length: 0

 

Ursachenforschung:

Meine Website im IIS hat einen „Host Name“ in den „Bindings“ eingetragen – werf ich den raus und browse auf die Website mit dem Netbios Namen funktioniert es wie gewünscht.

MS KB Article 896861: “…a… security feature … prevent reflection attacks on your computer. … authentication fails if … the custom host header … does not match the local computer name.

Lösung:

In obigen zitierten KB Artikel: “You receive error 401.1 when you browse a Web site that uses Integrated Authentication and is hosted on IIS 5.1 or a later version”

Bei “Method2:” -> Starten mit ”2. Click Start, click Run, type regedit, and then click OK.”

Nur die Einträge für BackConnectionHostNames machen:

BackConnectionHostNames in regedit

 

Iisreset.exe ausführen und danach funktioniert der Zugriff.