MachineKey 在 ASP.NET 中的用途

发布于 2024-07-13 20:30:39 字数 126 浏览 4 评论 0原文

机器密钥在 ASP.NET 中有哪些不同的用途? 我认为以下是正确的,但我认为可能还有更多。

  1. 多个应用程序可以使用相同的 cookie
  2. 多个服务器可以使用相同的视图状态

What different ways are Machine Keys useful in asp.net?
I think the following are correct but thought there may be more.

  1. Multiple applications can use the same cookie
  2. Multiple servers can work with the same viewstate

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

℡寂寞咖啡 2024-07-20 20:30:39

MachineKey 用于:

  • ViewState 加密和验证
  • 表单身份验证(或联合身份验证)使用此密钥签署身份验证票证

在多个服务器上安装 Web 应用程序需要在所有服务器上配置相同的计算机密钥,以便负载平衡正常工作。

要查看所有详细信息,请参阅:MSDN 如何:在 ASP 中配置 MachineKey .NET 2.0

MachineKey is used for:

  • ViewState encryption and validation
  • Forms Authentication (or Federated Authentication) uses this key for signing the authentication ticket

Having a Web App installed on multiple servers requires same Machine Key configured on all of them in order for Load Balancing to work.

To see all details, please refer to: MSDN How To: Configure MachineKey in ASP.NET 2.0

这样的小城市 2024-07-20 20:30:39

机器密钥还用于加密/解密 webresources.axd 参数。

即使在单个服务器上,也应该配置机器密钥,因为应用程序域的任何回收都会在设置为自动时生成新密钥。 这会导致下一次回发仅针对回收之前呈现的页面,从而导致视图状态验证错误,并且还会导致在此期间出现资源问题。

Machine key is also used to encrypt/decrypt the webresources.axd parameters.

Even on a single server the machine key should be configured, because any recycle of the app domain will generate a new key when it is set to auto. This causes the next postback just for pages rendered before the recycle, to cause a viewstate validation error, and also issues with the resources during that time.

菊凝晚露 2024-07-20 20:30:39

加密——很常见。

Encryption - very common.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文