简体   繁体   English

ASP.NET 4.7表单身份验证失败,提供的票证无效

[英]ASP.NET 4.7 Forms Authentication Failure, Ticket supplied was invalid

We are trying to change from TLS 1.0/1.1 to 1.2. 我们正在尝试将TLS 1.0 / 1.1更改为1.2。 The only protocol running is 1.2 and the .net and sql has been changed to support 1.2. 运行的唯一协议是1.2,并且.net和sql已更改为支持1.2。 It started giving us this error immediately when trying to log in. 尝试登录时,它立即开始为我们提供此错误。

Event code: 4005 Event message: Forms authentication failed for the request. 事件代码:4005事件消息:该请求的表单身份验证失败。 Reason: The ticket supplied was invalid. 原因:提供的票证无效。 Event time: 6/1/2018 9:27:58 AM Event time (UTC): 6/1/2018 1:27:58 PM Event ID: ed7b05ef18c84be1b02ae683df1b6e79 Event sequence: 2 Event occurrence: 1 Event detail code: 50201 事件时间:6/1/2018 9:27:58 AM事件时间(UTC):6/1/2018 1:27:58 PM事件ID:ed7b05ef18c84be1b02ae683df1b6e79事件序列:2事件发生:1事件详细代码:50201

This is in my web.config 这是在我的web.config中

    <authentication mode="Forms">
      <forms loginUrl="~/Login/MainLoginPage.aspx" defaultUrl="/default.aspx" name="LoginAuthCookie" timeout="525600" />
    </authentication>
  <location path="Mobile/Customers/CustomerList.aspx">
    <system.web>
      <httpRuntime requestValidationMode="2.0" />
    </system.web>
  </location>
  <location path="Mobile/Customers/JDE/NoCust.aspx">
    <system.web>
      <httpRuntime requestValidationMode="2.0" />
    </system.web>
  </location>
  <location path="login/mainloginpage.aspx">
    <system.web>
      <!--<pages validateRequest="false" />-->
      <httpRuntime requestValidationMode="2.0" />
    </system.web>
  </location>
  <location path="Applications">
    <system.web>
      <httpRuntime requestValidationMode="2.0" />
    </system.web>
  </location>

Our testing page still works but our production does not, they have the same web.config pages. 我们的测试页面仍然有效,但是我们的产品页面却没有,它们具有相同的web.config页面。

My question is does anyone know why this is happening and how to fix it? 我的问题是,是否有人知道为什么会发生这种情况以及如何解决? I have read up a few of the threads on this website, but they haven't been any help. 我已经阅读了该网站上的一些主题,但并没有任何帮助。 Let me know if you need more information and thank you in advance for your responses. 让我知道您是否需要更多信息,并在此先感谢您的答复。

You could add ServicePointManager.SecurityProtocol = (SecurityProtocolType) 3072; 您可以添加ServicePointManager.SecurityProtocol = (SecurityProtocolType) 3072; to Global.asax.cs. 到Global.asax.cs。

public class Global : System.Web.HttpApplication
{
    protected void Application_Start(object sender, EventArgs e)
    {
        ServicePointManager.SecurityProtocol = (SecurityProtocolType) 3072;
    }
}

I have to support TLS1.2 as my payment processor requires it, I believe all do now. 我必须支持TLS1.2,这是我的付款处理器所要求的,我相信现在都可以。 I was dealing with an 12 year old application so I didn't want to possibly introduce issues into the overall application so I inserted one line of code into the relevant page and all is well. 我当时使用的是12岁的应用程序,所以我不想在整个应用程序中引入问题,因此我在相关页面中插入了一行代码,一切都很好。 That one line is: 那一行是:

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12

This forces the httprequest that follows to connect using TLS1.2. 这将强制httprequest使用TLS1.2连接。 Works for me. 为我工作。

NOTE: I upgraded the entire app (not an issue) to .NET 4.5, earlier versions do not support TLS1.2 注意:我已将整个应用程序(不是问题)升级到.NET 4.5,早期版本不支持TLS1.2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 请求的 ASP.NET 表单身份验证失败。 原因:提供的票已过期 - ASP.NET Forms Authentication failed for the request. Reason: The ticket supplied has expired Jmeter&Forms身份验证票证(asp.net) - Jmeter & forms authentication ticket (asp.net) 在Asp.Net中使用cookieless表单身份验证票证的可能缺点 - Possible disadvantages of using cookieless forms authentication ticket in Asp.Net asp.net表单身份验证票据被篡改但仍然有效 - asp.net forms authentication ticket tampered but still works ASP.NET表单身份验证存储用户令牌/票证缓存 - ASP.NET forms authentication store user token/ticket cache .NET 2.0 Web App身份验证失败:“提供的票证无效” - .NET 2.0 Web App Authentication Failing: “The ticket supplied was invalid” ASP.NET SSL身份验证票证安全性? - ASP.NET SSL Authentication Ticket Security? 加密/创建ASP.NET Forms身份验证票证有哪些输入? - What inputs go into encrypting / creating an ASP.NET Forms Authentication Ticket? 如何使用RSA加密/解密ASP.Net表单身份验证票证 - How can I use RSA to Encrypt/Decrypt ASP.Net Forms Authentication Ticket 新创建的身份验证票证中的到期日期(asp.net表单auth) - expiration date in newly created authentication ticket (asp.net forms auth)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM