Uses for MachineKey in ASP.NET

前端 未结 3 1357
醉酒成梦
醉酒成梦 2020-12-09 10:18

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
相关标签:
3条回答
  • 2020-12-09 10:49

    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.

    0 讨论(0)
  • 2020-12-09 10:52

    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

    0 讨论(0)
  • 2020-12-09 10:55

    Encryption - very common.

    0 讨论(0)
提交回复
热议问题