我正在将一些站点移至运行 IIS6 的新 Windows 2003 安装。但是,我遇到了表单身份验证的问题。有问题的站点在操作系统和 IIS 版本相同的旧机器上运行良好。
当我尝试登录该网站时,我收到一个事件日志“请求的 URL 授权失败”并且页面重定向回:-
http://www.demo.socialclause.net/logout.aspx?ReturnUrl=/Secure/Procurement/Default.aspx
旧服务器和新服务器都包含相同的设置和相同的权限。显然我在某处错过了一个设置,但无法理解它。任何人都可以帮忙吗?
我的 web.config 包含这个:-
<authentication mode="Forms">
<forms slidingExpiration="true" name=".ASPXAUTH" protection="All" loginUrl="~/logout.aspx" timeout="60" ></forms>
</authentication>
Run Code Online (Sandbox Code Playgroud)
在 /secure 目录(这不是虚拟目录)中,我的 web.config 包含:-
<?xml version="1.0"?>
<configuration>
<system.web>
<authorization>
<allow roles="ClauseAdmin"/>
<allow roles="ProcurementAdmin"/>
<allow roles="ReportAdmin"/>
<allow roles="SystemAdmin"/>
<deny users="*"/>
</authorization>
</system.web>
</configuration>
Run Code Online (Sandbox Code Playgroud)
事件日志显示:
Event Type: Information
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1314
Date: 26/05/2009
Time: 21:01:05
User: N/A
Computer: WILDEAA1
Description:
Event code: 4007
Event message: URL authorization failed for the request.
Event time: 26/05/2009 21:01:05
Event time (UTC): 26/05/2009 20:01:05
Event ID: af3bac34e6d74630b937a5a05d0f25f2
Event sequence: 4
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/2067908276/Root-1-128878416581538912
Trust level: Full
Application Virtual Path: /
Application Path: C:\Inetpub\websites\www.demo.socialclause.net\htdocs\
Machine name: WILDEAA1
Process information:
Process ID: 1076
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
Request information:
Request URL: http://demo.socialclause.net/Secure/Procurement/Default.aspx
Request path: /Secure/Procurement/Default.aspx
User host address: 91.84.25.241
User: richard@wildesoft.net
Is authenticated: True
Authentication Type: Forms
Thread account name: NT AUTHORITY\NETWORK SERVICE
Run Code Online (Sandbox Code Playgroud)
尝试拒绝用户?(匿名)代替*(全部)
<authentication mode="Forms">
<forms name=".ASPXFORMSAUTH" loginUrl="~/Common/Login.aspx" timeout="450" />
</authentication>
<authorization>
<deny users="?" />
<allow roles="Admin" />
</authorization>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
23775 次 |
| 最近记录: |