.NET 2.0 Web App Authentication Failing: “The ticket supplied was invalid”

后端 未结 5 847
名媛妹妹
名媛妹妹 2021-01-23 19:18

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 reques

相关标签:
5条回答
  • 2021-01-23 19:52

    There is also one more cause of this problem. Even on the same machine, same IIS and same .NET framework if one of your applications has

    <httpRuntime requestValidationMode="2.0" />
    

    then sharing authentication cookie will not work.

    Removing requestValidationMode solves the problem. But sometimes you cannot do it and it needs to stay there. I'm yet to discover what to do in such situation

    0 讨论(0)
  • 2021-01-23 20:04

    You must have the same framework on the 2 applications.

    httpRuntime targetFramework="4.5"

    0 讨论(0)
  • 2021-01-23 20:06

    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" />
    

    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" />
    
    0 讨论(0)
  • 2021-01-23 20:06

    I had the same issue. In my case i had two different applications in the same server and the name attribute was the same for both.

    The solution is to use a unique name for each application. See mode details here https://msdn.microsoft.com/en-us/library/1d3t3c61(v=vs.85).aspx

    It is the cookie name and if you use the same name the cookie is overridden.

    0 讨论(0)
  • 2021-01-23 20:13

    With the intention of aport info to the previous post, it works for me adding this keys into the APP (both 4.0) web.config:

        <add key="aspnet:UseLegacyEncryption" value="true" />
        <add key="aspnet:UseLegacyFormsAuthenticationTicketCompatibility" value="true" />
    
    0 讨论(0)
提交回复
热议问题