.NET 2.0的Web应用程序的身份验证失败:"提供的票是无效的"应用程序、身份验证、NET、QUOT

由网友(゛给不了你要的幸福っ)分享简介:我有一个.NET 4.0应用程序与2.0应用程序作为一个孩子。该web应用程序不在多服务器环境;仅涉及在服务这些请求一个服务器。这两个应用程序都使用自定义的验证以及应用程序具有相同的machineKey 属性和值。当我访问了2.0应用程序事件日志中显示以下信息:I have a .NET 4.0 applicatio...

我有一个.NET 4.0应用程序与2.0应用程序作为一个孩子。该web应用程序不在多服务器环境;仅涉及在服务这些请求一个服务器。这两个应用程序都使用自定义的验证以及应用程序具有相同的machineKey 属性和值。当我访问了2.0应用程序事件日志中显示以下信息:

I have a .NET 4.0 application with a 2.0 application as a child. The web applications are not in a multi-server environment; only one server is involved in serving these requests. Both applications are using custom authentication and both applications have the same machineKey attributes and values. When I visit the 2.0 application the event log is showing the following message:

Event code: 4005 
Event message: Forms authentication failed for the request. Reason: The ticket supplied was invalid. 
Event time: 12/2/2011 11:36:49 AM 
Event time (UTC): 12/2/2011 5:36:49 PM 
Event ID: 2068ad6957964f75885301fc2b58ddfe 
Event sequence: 2 
Event occurrence: 1 
Event detail code: 50201

我尝试设置 ticketCompatibilityMode 属性Framework20在Web.config表单元素,但是这并没有解决问题。由于此错误,用户没有被授权,并且作为结果的通常对象(HttpContext的)不被填充的用户信息。

I tried setting the ticketCompatibilityMode attribute to Framework20 on the forms element in the Web.config, but that didn't solve the issue. Because of this error, the user isn't being authorized, and as a result the usual objects (HttpContext) isn't being populated with the user information.

有谁知道如何解决这个错误使认证工作将在2.0应用程序? (顺便说一句,我不打算获得2.0应用程序升级到4.0,但它不是在卡来完成在这个时候)

Does anyone know how to fix this error so authentication will work for the 2.0 application? (As an aside, I do plan on getting the 2.0 application upgraded to 4.0, but it isn't in the cards to complete at this time)

推荐答案

在万一有人遇到同样的问题,我能够加入一些条目到&LT来修复这个错误;的appSettings> 我的.NET 2.0应用程序的Web.config的部分。添加的条目为:

In case someone comes across this same issue, I was able to fix this error by adding some entries to the <appSettings> section of my .NET 2.0 application's Web.config. The added entries were:

<add key="aspnet:UseLegacyEncryption" value="true" />
<add key="aspnet:UseLegacyMachineKeyEncryption" value="true" />

修改(2012-05-04):在服务器上安装安全公告MS11-100后,认证再次打破在2.0应用程序。加入以下的4.0应用程序的Web.config固定的问题:

Edit (2012-05-04): After installing Security Bulletin MS11-100 on the server, the authentication once again broke on the 2.0 application. Adding the following to the Web.config of the 4.0 application fixed the issue:

<add key="aspnet:UseLegacyFormsAuthenticationTicketCompatibility" value="true" />
阅读全文

相关推荐

最新文章