ASP.NET Identity 2 是否使用 machinekey 来散列密码? [英] Does ASP.NET Identity 2 use machinekey to hash the password?

查看:23
本文介绍了ASP.NET Identity 2 是否使用 machinekey 来散列密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 ASP.NET MVC 5 中创建了一个应用程序.现在我需要在服务器上部署该应用程序.部署时,我现有的密码是否适用于 ASP.NET Identity 2?或者我是否需要使用我在客户端机器中拥有的相同机器密钥?

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?

推荐答案

您不需要为密码设置机器密钥.机器密钥用于加密/解密(ViewState、Session、Cookies 等),而不是用于散列.

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.

如果您使用应用程序的多个实例(想想 Azure 云服务),那么您需要设置机器密钥,以便可以跨实例使用 cookie 和身份验证票证.

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.

这篇关于ASP.NET Identity 2 是否使用 machinekey 来散列密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆