You are not authorized to view this page - asp.net

I am getting the following error while browsing the my webpage
i checked and seen anaymous access has been enabled and integrated aunthentication has been turned off ...
Could you please help?
You are not authorized to view this page
You do not have permission to view this directory or page using the credentials that you supplied.
--------------------------------------------------------------------------------
Please try the following:
Contact the Web site administrator if you believe you should be able to view this directory or page.
Click the Refresh button to try again with different credentials.
HTTP Error 401.1 - Unauthorized: Access is denied due to invalid credentials.
Internet Information Services (IIS)
Open in New WindowSelect All
Tags:
Add Tags
Add Tags
Zones:
Microsoft IIS Web Server, .Net Application Servers, Programming for
My web.conf look like below:
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>

You should also check the NTFS permissions on the directory and files in your web site itself. The easiest way to determine if this is the problem is by giving Everyone READ access. Test it. Then remove the Everyone entry. If that had solved the problem, find out what user account the IIS application pool hosting your web app uses, and add that user account to the NTFS permissions list giving that user Read access.

Related

Error 401.3 not authorized when NOT using impersonation

I am trying to access an old fashioned asmx web service hosted in IIS and I am banging my head against a 401.3 error. I know there are lot of resources out there but most of them make use of impersonation and by adding permissions for the authorized user to the file system, which I want to avoid.
My scenario is basically an IIS webservice, running with an AppPool which runs as a specific service account (DOMAIN\username + password). This service account has full control on the folder and the Anonymous authentication is set to use the AppPool Identity.
This is all good and working but now I wanted to secure my webservice by adding Windows authentication. I did that and added a simple <deny users="?" /> to the authorization section. What happens now is that when I connect to the server I get asked for a username and pwd, I provide one and then I get a 401.3 error.
I have tried adding read&execute permissions for myself to the folder and everything works but this is clearly not a proper solution as I would have to keep managing folder permissions.
My question is: why does the authenticated user needs folder access? Isn't the folder accessed as the app pool identity? Impersonation is disabled so I would expect that to be the proper behaviour.
why does the authenticated user needs folder access?
The FileAuthorization module requires the authenticated user to have permissions to the file.
Isn't the folder accessed as the app pool identity
Yes, but the above module also checks the authenticated user. You mentioned that you have Anonymous set to use AppPoolIdentity, so I'd expect in your case, this to be true.
Impersonation is disabled so I would expect that to be the proper behaviour.
This is independent as the FileAuthorization module kicks in anyways.
By recommendation for how to troubleshoot would be grab a ProcMon trace and I suspect you'll see some AccessDenied. Go look and see what permissions are required by what process and see if its doing impersonation (for this check). This will tell you what permission is missing/failing.

Cannot get Orchard CMS site to load on Network Solutions Windows Hosting

I get the following .NET error when trying to load my Orchard CMS website:
Access to the path '\\.........\www\App_Data\Dependencies\Lucene.dll' is denied.
Exception Details: System.UnauthorizedAccessException: Access to the path '\\WDP\DFS\30\7\4\5\3024678547\user\sites\5481517.site\www\App_Data\Dependencies\Lucene.dll' is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in File Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
How do I actually go about granting access rights? I've googled and found I should go into the server and right-click on the directory and edit the properties. BUT, I am in a shared hosting plan and don't think I can do that.
Am I pretty much at a dead end?
Things I've tried:
Setting file permissions through FTP, but I get a:
500 'SITE CHMOD 777...command not understood
I've downloaded and installed IIS Manager and successfully connected to my site, but still did not find any options to set permissions in there.
I've also called Network Solutions, but all I was told was to try to do the file permissions settings (as I mentioned above).
Thanks in advance.

CSS not referring after hosting in iis

I m using vs2010 and iis 7
i hosted my web app in iis 7
like http://localhost/TestUI/login.aspx
But the css file not referring..!
I opened the developer options and tried to see the css file
like http://localhost/TestUI/css/style1.css
It throwing error like
401.3 - unathorized - You do not have permission to view this directory or page because of the access control list (ACL)
configuration or encryption settings for this resource on the Web
server.
I have tried many ways to solve it..
Gave access to IUSR to wwwroot folder in properties -> security
Changed Anonymous Authentication to Application pool identity
Used (~) in the css url in aspx page
But don't know how to solve it ! what to do !!
As per MSDN
This problem occurs when permissions for the file that the user is trying to access are denied to that user. This error message differs from a standard 401 error message, in that, the user has been logged on to the server, but the resource that the user is trying to access is restricted. For example, if only Administrators and LocalSystem have access to a file on the server and a user, who is a member of the Users group, tries to access it, the user receives a 401.3 (provided they can log on to the server).
The resolution states to check the NTFS permission on that file. Make sure users can access the same.
I found a thread that could help you with the solving the same. As per the thread,
IIS 7 also creates "IUSR" as default user to access files via IIS. So make user IUSR has read access to files/folders.
How to check if IUSR has read Access? Right Click -> Folder -> Properties -> Security Tab See if IUSR is in Group or user names list, If No.
Click Edit -> Add -> Advanced -> Find Now -> Select IUSR and click OK four times

Error 401 for my ASP.NET app on IIS 6.0

I've just wrote a legacy app on IIS 6.0 (.NET 1.0, don't even ask why!). One of the requirements is to have "Integrated Windows Authentication" disabled on the Virtual directory.
http://localhost/test.html
When I disable that, I get a error 401.1 on the IIS root's test.html, which consists of "Hello World"
You are not authorized to view this page You do not have permission to
view this directory or page using the credentials that you supplied.
Please try the following:
•Contact the Web site administrator if you believe you should be able
to view this directory or page. •Click the Refresh button to try again
with different credentials. HTTP Error 401.1 - Unauthorized: Access is
denied due to invalid credentials. Internet Information Services (IIS)
When IWM is enabled, the website works like a gem.
Does anyone know what is the root cause? This doesn't appear to be an issue with my app since even the default test.html fails with authentication
You will most likely need to set the correct folder permissions for the 'Anonymous' user on the folder you are accessing.
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/f594e137-e2da-4b22-ab58-f8edba938802.mspx?mfr=true
edit: this is the more relevant link:
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/9ded7af2-fcb7-4ed2-b007-e19f971f6e13.mspx?mfr=true
Issue was resolved with removing Guest and Anonymous restriction from the local security policy

asp.net iis error

I am using asp.net 2.0 and IIS 7 on vista 64 bit.
everytime, when i try to open page in browser, i get following error.
Access is denied.
Description: An error occurred while accessing the resources required to serve this request. You might not have permission to view the requested resources.
Error message 401.3: You do not have permission to view this directory or page using the credentials you supplied (access denied due to Access Control Lists). Ask the Web server's administrator to give you access to 'C:\example\WebApplication1\WebApplication1\Default.aspx'.
Does your application pool's user have read permissions to the files you're trying to serve? By default, this should be the NETWORK SERVICE user.
Your ASPNET user will also need access.
Permissions can be set here:
Right click the directory or file --> Properties --> Security tab
You need to give the permission to user name "Internet Guest Account" on C:\example directory on an inner directory given you have used the same user in the IIS anonymous setting.
Give your aspnet local user permission to the directory you're trying to access.
You need to add permission to the user binded with Application Pool on folder in which is your website.
The name of the user is usually IUSR, NETWORK SERVICE or IIS_IUSRS.
Permision to the root: Read and Execute, List folder and read
Permission to the root/App_Data: All
Or another approach could be to set the username in the application pool (Advance setting -> Identity) to the username which has rights to read the directory. You may need create new application pool.

Resources