您无权查看此页面的活动目录问题

时间:2009-12-07 15:05:22

标签: .net asp.net vb.net iis

我在浏览IIS中部署的asp.net页面时遇到以下错误。我在我的网站中使用活动目录数据检索,并且活动目录的凭据存储在web.config文件中......

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)

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

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.

任何助手?

3 个答案:

答案 0 :(得分:2)

如果您使用Visual Studio进行开发,请转到“网站”标签,然后点击ASP.NET Configuration。服务器将启动,通过单击安全链接,您将能够管理对网站的访问。

这也可以在您的网络服务器上的IIS中完成,运行IIS管理器突出显示您的网站并点击.net authrization

上述两个步骤是使用GUI完成的。

但是,您可以通过整个网站的web.config文件轻松编辑作者,或者如果您的页面保存在文件夹中,则单独编辑它们。

代码:

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

在上面的代码中,Admins是在ASP.NET配置实用程序后面或代码中设置的角色。如果您要求拒绝匿名用户访问,即。那些未在Intranet上登录的用户可以使用:

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

但是我不太确定上面的代码,如果订单被切换,它可能会禁止所有用户甚至是非匿名用户。

从您的描述中看来,在这种情况下,每个用户都可以进行授权:

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

答案 1 :(得分:0)

你问这个问题已经好几年了,但以防万一其他人正在寻找答案:

启用Windows身份验证,然后按照以下文章进行操作:

IIS 7 Error

答案 2 :(得分:0)

在IIS 6中,右键单击您的Web应用程序,选择“属性”&gt;目录标签&gt;配置按钮&gt;插入新的通配符应用程序映射并将此值放入: C:\ Windows \ Microsoft.NET \框架\ v4.0.30319 \ ASPNET_ISAPI.DLL