Click here to Skip to main content
15,884,007 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am using window authentication for intranet application.
My application throw error when user access this application.
error is :

401 - Unauthorized: Access is denied due to invalid credentials.
You do not have permission to view this directory or page using the credentials that you supplied.

Please help what is issue ?

Thanks
Ganu

[edit]From OP:
HTML
<configuration>
  <configsections>
    <sectiongroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <sectiongroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirepermission="false" allowdefinition="MachineToApplication"></section>
        <sectiongroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirepermission="false" allowdefinition="Everywhere"></section>
          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirepermission="false" allowdefinition="MachineToApplication"></section>
          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirepermission="false" allowdefinition="MachineToApplication"></section>
          <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirepermission="false" allowdefinition="MachineToApplication"></section>
        </sectiongroup>
      </sectiongroup>
    </sectiongroup>
  </configsections>
  <appsettings>
    <add key="con" value="constr"></add>
  </appsettings>
  <connectionstrings>
    <add name="con" connectionstring=""></add>
  </connectionstrings>
  <system.web>

    <httpruntime executiontimeout="9999999" maxrequestlength="2048000"></httpruntime>
    <compilation debug="false">
      <assemblies>
        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"></add>
        <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"></add>
        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"></add>
        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"></add>
        <add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"></add>
        <add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"></add>
        <add assembly="Microsoft.Build.Framework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"></add>
        <add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"></add>
      </assemblies>
      <buildproviders>
        <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"></add>
      </buildproviders>
    </compilation>
    <!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
    <authentication mode="Windows"></authentication>
    <customerrors mode="Off"></customerrors>
    <!--
            The <customerrors> section enables configuration 
 </customerrors></authentication></system.web></configuration>


[/edit]
Posted
Updated 8-Oct-12 22:58pm
v2
Comments
Al Moje 9-Oct-12 2:18am    
Could you show us your code?
I.explore.code 9-Oct-12 4:05am    
can you post your web.config settings here? I think the error is quite self-explanatory, the credentials i.e. username and password are wrong. DO make sure that's not the case.
Sharma Ganu 9-Oct-12 4:53am    
See modified question.
Richard MacCutchan 9-Oct-12 5:00am    
Please use the "Improve question" link to add information to your original post.
I.explore.code 9-Oct-12 5:06am    
Config seems fine. Can you also check your IIS settings (authentication related) for me? Make sure that's set to Windows as well.

To resolve this issue, you must turn off Simple File Sharing, and then take ownership of the folder:

Turn off Simple File Sharing:
Click Start, and then click My Computer.
On the Tools menu, click Folder Options, and then click the View tab.
Under Advanced Settings, click to clear the Use simple file sharing (Recommended) check box, and then click OK.
Right-click the folder that you want to take ownership of, and then click Properties.
Click the Security tab, and then click OK on the Security message, if one appears.
Click Advanced, and then click the Owner tab.
In the Name list, click your user name, Administrator if you are logged in as Administrator, or click the Administrators group.

If you want to take ownership of the contents of that folder, click to select the Replace owner on subcontainers and objects check box.
Click OK.

You may receive the following error message, where Folder is the name of the folder that you want to take ownership of:
You do not have permission to read the contents of directory Folder. Do you want to replace the directory permissions with permissions granting you Full Control? All permissions will be replaced if you press Yes.
Click Yes.
Click OK, and then reapply the permissions and security settings that you want for the folder and the folder contents.

source: http://support.microsoft.com/kb/810881[^]
 
Share this answer
 
Exactly same issue someone else had. See if this 401 - Unauthorized: Access is denied due to invalid credentials[^] works
 
Share this answer
 
Comments
Moyesa 4-Oct-14 7:40am    
I am created Login Page using MVC4 when am run this project i got error like this
HTTP Error 401.0 - Unauthorized
You do not have permission to view this directory or page.
pls can anybody tell me how to resolve this issue.Actually i am new to MVC.Thanks

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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