开发者

You are not authorized to view this page active directory problem

开发者 https://www.devze.com 2022-12-13 21:31 出处:网络
I am getting the following error while browsing my asp.net page deployed in IIS..I am using active directory data retrieval in my website and credentials to the active directory is stored in the web.c

I am getting the following error while browsing my asp.net page deployed in IIS..I am using active directory data retrieval in my website and credentials to the active directory is stored in the web.config file ...

You are not authorized to view this page
You do not have permissi开发者_运维百科on 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)

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Go to Microsoft Product Support Services and perform a title search for the words HTTP and 401. 
Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled Authentication, Access Control, and About Custom Error Messages.

Any helping hands ??


If you are using Visual Studio to develop go to the 'website' tab and click ASP.NET Configuration. The server will start and by clicking the security link you will be able to manage access to the website.

This can also be done in IIS on your webserver, run the IIS Manager highlight your site and click .net authrization.

The two above steps are done using a GUI.

However you can just as easily edit authorzations via the web.config file for the entire site, or if your pages are held in folders edit them seperately.

The code:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.web>
        <authorization>
          <allow roles="Admins"/>
          <deny users="*" />
        </authorization>
    </system.web>
</configuration>

In the above code Admins is a role that has been setup in the code behind or in the ASP.NET configuration utility. If you require to just deny access to anonymous users ie. those users not logged in on the intranet you can use:

<authorization>
          <allow users="?"/>
          <deny users="*" />
</authorization>

However I am not too sure of the code directly above, if the order is switched it may disallow all users even non-anonymous users.

From your description it seems that authorization is done per user in that case:

<authorization>
         <allow users="DOMAIN\SAMACCONTNAME", "Company\SCOTTG"/>
         <deny users="*" />
</authorization>


It's been years since you have asked the question, but just in case someone else is looking for the answer:

Enable Windows Authentication, and follow the below article:

IIS 7 Error


In IIS 6, right click on your web application, choose Properties > Directory Tab > Configuration Button > Insert new wildcard application map and put this value: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号