Does ASP.NET Identity 2 use machinekey to hash the

2019-01-27 00:59发布

问题:

I have created an application in ASP.NET MVC 5. Now I need to deploy the application on the server. Will my existing passwords work in ASP.NET Identity 2 when I deploy? Or do I need to use the same machine key that I have in my client machine?

回答1:

You do not need to set the machine key for passwords. The machine key is used for encryption/decryption (ViewState, Session, Cookies, etc.) not for hashing.

If you are using multiple instances of the application (think Azure Cloud Service) then you'll want to set the machine key so that cookies and auth tickets can be used across instances.