Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET IIS
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:
<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 8-Oct-12 20:11pm
Edited 8-Oct-12 22:58pm
v2
Comments
Al Moje at 9-Oct-12 2:18am
   
Could you show us your code?
gladiatron at 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 at 9-Oct-12 4:53am
   
See modified question.
Richard MacCutchan at 9-Oct-12 5:00am
   
Please use the "Improve question" link to add information to your original post.
gladiatron at 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.
Sharma Ganu at 9-Oct-12 5:39am
   
i checked its set window authentication is enable.
Sharma Ganu at 9-Oct-12 5:41am
   
from one one months its work fine. but from today i got this problem.
today i published my project & uploaded.
i got this issue. please suggest.
thanks.
Zoltán Zörgő at 9-Oct-12 5:06am
   
And have you added yourself to the authorized users on IIS side? What IIS? Is ASP.NET enabled?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Exactly same issue someone else had. See if this 401 - Unauthorized: Access is denied due to invalid credentials[^] works
  Permalink  
Comments
Moyesa at 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
0 Sergey Alexandrovich Kryukov 586
1 OriginalGriff 311
2 Maciej Los 170
3 Mehdi Gholam 145
4 PIEBALDconsult 140
0 Sergey Alexandrovich Kryukov 11,384
1 OriginalGriff 5,783
2 Maciej Los 5,684
3 CPallini 3,879
4 BillWoodruff 3,584


Advertise | Privacy | Mobile
Web02 | 2.8.141030.1 | Last Updated 9 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100