Click here to Skip to main content
15,889,027 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to solve this problem Windows authentication working properly but in Server Windows Authentication not working it's an error generate?

401 - Unauthorized: Access is denied due to invalid credentials.


In Web.config
______________

XML
<system.web>
   <authentication mode="Windows"></authentication>
   <!--<authorization>
     <deny users="?" />
   </authorization>-->

   <trust level="Full" />
   <httpRuntime targetFramework="4.5" />
   <compilation targetFramework="4.5" />
   <pages>
     <namespaces>
       <add namespace="System.Web.Helpers" />
       <add namespace="System.Web.Mvc" />
       <add namespace="System.Web.Mvc.Ajax" />
       <add namespace="System.Web.Mvc.Html" />
       <add namespace="System.Web.Routing" />
       <add namespace="System.Web.Optimization" />
     </namespaces>
   </pages>
   <customErrors mode="Off"></customErrors>
 </system.web>


What I have tried:

In Web.config
______________

XML
<system.web>
   <authentication mode="Windows"></authentication>
   <!--<authorization>
     <deny users="?" />
   </authorization>-->

   <trust level="Full" />
   <httpRuntime targetFramework="4.5" />
   <compilation targetFramework="4.5" />
   <pages>
     <namespaces>
       <add namespace="System.Web.Helpers" />
       <add namespace="System.Web.Mvc" />
       <add namespace="System.Web.Mvc.Ajax" />
       <add namespace="System.Web.Mvc.Html" />
       <add namespace="System.Web.Routing" />
       <add namespace="System.Web.Optimization" />
     </namespaces>
   </pages>
   <customErrors mode="Off"></customErrors>
 </system.web>
Posted
Updated 3-May-16 0:48am
v3
Comments

1 solution

You just need to setup the site in IIS properly. We can't do that for you obviously, so you will have to do it. However, I would first look at the identity used to run the Application Pool in IIS. Reset that account because that is most likely where your error is coming from.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900