加密/创建 ASP.NET Forms 身份验证票证需要哪些输入?
我读到的所有内容都表明 web.config 文件中的 MachineKey 元素是确定加密票证值的唯一因素,但目前我有很多证据与此相矛盾。
所以我的问题是:假设机器密钥和票证内的数据相同,什么可以使票证加密值(特别是长度)不同?
编辑
我们是查看时间戳导致的值变化。然而,在其中一种环境中,所创造的价值本身要短得多。其中两个站点(.NET 4、MVC2/3)可以很好地应对它。然而,.NET 2.0 / WebForms 站点无法使用相同的计算机密钥对其进行解密。
Everything I read points to the MachineKey element in the web.config file being the only thing that determines the encrypted ticket value, but I have a lot of evidence to contradict that at the moment.
So my question is: what can make the ticket encryption value (particularly the length) different, given that the machine key and the data inside the ticket is identical?
EDIT
We are seeing the changes in the value as a result of timestamps. However in one of the environments the created values themselves are much shorter. Two of the sites (.NET 4, MVC2/3) cope with it just fine. A .NET 2.0 / WebForms site, however, can't decrypt it with the same machine key.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
MachineKey 确定其加密/解密方式。内容包括时间戳,因此即使您输入相同的数据,也可以解释不同的加密值。
MachineKey determines how it is encrypted/decrypted. The contents include a timestamp so even if you put in the same data, that would explain the different encrypted values.
因此,虽然 MachineKey 和加密算法确实决定了生成的加密值,但我们已经确认有 肯定会影响机器密钥加密/解密的补丁。
当我们一半的网络场被修补时,这一点变得很明显,这产生了与其他长度不同的加密票。这是一大堆补丁,因此我们无法确定导致不同行为的确切补丁。
因此...如果其他人遇到这种非常奇怪的行为,请确保在故障排除时比较应用于每个服务器的补丁和修补程序。
So, while the MachineKey and encryption algorithm do decide the encrypted value produced, we have confirmed that there are definitely patches that can affect machine key encryption / decription.
This became evident when half of our web farm was patched, which produced encrypted tickets of different lengths than the others. It was a large set of patches, so we were unable to determine the exact patch that caused the different behavior.
So...if anyone else experiences this very strange behavior, make sure you compare the patches and hotfixes applied to each server when troubleshooting.