This article is a mirror article of machine translation, please click here to jump to the original article.

View: 15416|Reply: 0

[ASP.NET] ASP.NET The role of machineKey and how to use it

[Copy link]
Posted on 2/14/2016 11:24:21 AM | | |

ASP.NET the role of machineKey

If your Asp.Net runs the program and encounters this error: "Validate view status MAC failed." If this application is hosted by a network farm or cluster, ensure that the <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. So what is the purpose of machineKeys if you don't have your application using a unified machineKey? According to MSDN standards: "Configure keys to be used to encrypt and decrypt Forms authentication cookie data and view state data, and to validate out-of-process session state identities." In other words, many of the encryptions Asp.Net rely on the values in the machineKey, such as the Forms authentication cookie and the encryption of the ViewState. By default, the configuration of the Asp.Net is dynamically generated by itself, if a single server is of course fine, but if multiple servers are load balanced, machineKey also adopts a dynamic generation method, the machinekey value on each server is inconsistent, resulting in inconsistent encrypted results, and cannot share verification and ViewState, so for multiple server load balancing, the same machineKey must be configured at each site.

Algorithm generated ASP.NET machineKey:







Previous:C# Analog Mouse Keyboard Operation [Self-test, indeed available]
Next:Regarding the compatibility issue of SQL 2000 database attachment to SQL 2012
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com