401 Custom Error Page Breaks Windows Authentication

By
Published 03-26-2021 10:54 AM 490 Views
Microsoft

IIS has an easy way to add custom error pages in IIS Manager. However, using IIS Manager for adding a custom page for 401 status code may cause issues with Windows Authentication. Your website may keep prompting credentials even though you enter the correct username and password.

 

It is expected for Windows Authentication to be unfunctional if there is a new custom error page for 401 status. As a workaround, I would recommend editing the IIS default error page located at %SystemDrive%\inetpub\custerr\en-US\401.htm

Nedim_0-1616781258247.jpeg

 

Open this file in notepad and make changes. Then save it as htm file and replace the existing one.

%3CLINGO-SUB%20id%3D%22lingo-sub-2238309%22%20slang%3D%22en-US%22%3E401%20Custom%20Error%20Page%20Breaks%20Windows%20Authentication%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2238309%22%20slang%3D%22en-US%22%3E%3CP%3EIIS%20has%20an%20easy%20way%20to%20add%20custom%20error%20pages%20in%20IIS%20Manager.%20However%2C%20using%20IIS%20Manager%20for%20adding%20a%20custom%20page%20for%20401%20status%20code%20may%20cause%20issues%20with%20Windows%20Authentication.%20Your%20website%20may%20keep%20prompting%20credentials%20even%20though%20you%20enter%20the%20correct%20username%20and%20password.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20is%26nbsp%3Bexpected%20for%20Windows%20Authentication%20to%20be%20unfunctional%20if%20there%20is%20a%20new%26nbsp%3Bcustom%20error%20page%20for%20401%20status.%20As%20a%20workaround%2C%20I%20would%20recommend%20editing%20the%20IIS%20default%20error%20page%20located%20at%20%25SystemDrive%25%5Cinetpub%5Ccusterr%5Cen-US%5C401.htm%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Nedim_0-1616781258247.jpeg%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F267524i73ADB73CF15BF98F%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Nedim_0-1616781258247.jpeg%22%20alt%3D%22Nedim_0-1616781258247.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOpen%20this%20file%20in%20notepad%20and%20make%20changes.%20Then%20save%20it%20as%20htm%20file%20and%20replace%20the%20existing%20one.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2238309%22%20slang%3D%22en-US%22%3E%3CP%3EUsing%20IIS%20Manager%20for%20adding%20a%20custom%20page%20for%20401%20status%20code%20may%20cause%20issues%20with%20Windows%20Authentication%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Co-Authors
Version history
Last update:
‎Mar 26 2021 10:54 AM
Updated by: