是窗体身份验证哈希依赖于机器? [英] Is Forms Authentication Hash machine dependent?

查看:78
本文介绍了是窗体身份验证哈希依赖于机器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算用这块code在我的Asp.net应用程序

I'm planning to use this piece of code in my Asp.net app

string strUserInputtedHashedPassword = FormsAuthentication.HashPasswordForStoringInConfigFile(tbPassword.Text, "sha1");
if(strUserInputtedHashedPassword == GetUsersHashedPasswordUsingUserName(tbUserName.Text))
{
   // sign-in successful
}
else
{
   // sign-in failed
}

时的散列依赖于机器的......在这个意义上,如果我创造我的机器有些用户在我的开发数据库......有一次,我都张贴DB和生产环境的用户表申请,会把密码用户是一样的...

Is the Hashing machine dependent... In the sense, If I create some users in my development machine in my development DB... Once I post both DB and Application to production environment with the user table, will the password for the users be same...

希望我做我的问题清楚......否则,请让我知道..

Hope I made my question clearly... Otherwise, please let me know..

感谢

推荐答案

散列连接codeD和DE codeD使用的的machineKey在machine.config 的,如果你要的关键,对所有层次的工作,的确保在machine.config文件中的关键字匹配

The hash is encoded and decoded using the machineKey in the machine.config, if you want the key to work against all tiers, make sure the keys in the machine.config files match.

这基本上是你与Web服务的农场请求,并确认对方的饼干遇到同样的问题......同样的解决方案。

This is basically the same problem you encounter with a web farm serving requests and validating each other's cookies...same solution.

这篇关于是窗体身份验证哈希依赖于机器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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