【发布时间】:2011-05-03 16:20:42
【问题描述】:
我有两个网站,它们都在各自独立的 ASP.NET 身份验证数据库中创建用户。下面是两者的 Web.configs。我还在两个解决方案上使aspnet_Applications 数据库记录相同。当我创建一个用户时,加密的密码不一样,密码盐也不一样。
知道如何让两个网站在两个系统具有相同的用户名和密码时创建相同的密码哈希吗?
<configuration>
<system.web>
<authentication mode="Forms" >
<!-- The name, protection, path, validationKey, validation, decryptionKey,
and decryption attributes must be identical across all applications.
-->
<forms loginUrl="~/Account/Login"
name=".ASPXAUTH"
protection="All"
path="/"
domain="contoso.com"
timeout="2880"
requireSSL="false"
cookieless="UseCookies"
enableCrossAppRedirects="true" />
</authentication>
<!-- Validation and decryption keys must exactly match and cannot
be set to "AutoGenerate". The validation and decryption
algorithms must also be the same. -->
<!-- The validationKey is not wrapped in the solution -->
<!-- These keys are examples -->
<machineKey
validationKey="C50B3C89CB21F4F1422FF158A5B42D0E8DB8CB5CDA1742572A487D940
1E3400267682B202B746511891C1BAF47F8D25C07F6C39A104696DB51
F17C529AD3CABE"
decryptionKey="8A9BE8FD67AF6979E7D20198CFEA50DD3D3799C77AF2B72F"
validation="SHA1"
decryption="Auto" />
</system.web>
</configuration>
【问题讨论】:
标签: .net asp.net security asp.net-mvc-3 asp.net-membership