Why does httpRuntime targetFramework=“4.5” disable grabbing the .ASPXAUTH cookie?

荒凉一梦 提交于 2019-12-05 14:26:06

I had similar problem - my app with runtime 4.5 was unable to read an .ASPXAUTH cookie created by another /login/ app that was running under 4.0, causing a redirect loop. Turns out 4.5 introduces some cryptography improvements that could be enabled by setting the following in web.config:

Cause:

<machineKey compatibilityMode="Framework45" />

or

<httpRuntime targetFramework="4.5" />

https://blogs.msdn.microsoft.com/webdev/2012/10/23/cryptographic-improvements-in-asp-net-4-5-pt-2/1

Solution: In my case (many other 4.0 apps relied on the cookie) the solution was to switch my new app to use:

<machineKey compatibilityMode="Framework20SP1" validationKey="..shared with login app, along with decryptionKey etc...">

or

remove the <httpRuntime /> element

Of course this is only a workaround and I am going to update all my apps to the more secure 4.5 authentication ASAP.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!