DpapiDataProtectionProvider构造函数中appName有什么影响
What is the impact of appName in DpapiDataProtectionProvider constructor
在我们的 IdentityManager
class 中,我们有以下行:
protectionProvider = new DpapiDataProtectionProvider("OurProduct");
最后一个参数的含义是什么,它与网站在 IIS 上的设置方式有什么关系吗?
背景:
长期以来,我们一直在将具有自定义 IdentityManager
class 的 MVC5 站点部署到验证环境中,没有任何麻烦,现在我们在尝试重置用户密码时遇到以下问题:
System.Security.Cryptography.CryptographicException: The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread's user context, which may be the case when the thread is impersonating.
以下线程中描述了一些解决方案:
Generating reset password token does not work in Azure Website
一切都位于同一台机器上:IIS、Sql 服务器、Firefox 测试浏览器。
不幸的是,我没有完全掌握这些概念,我正试图弄清楚测试环境是如何改变的,以便在以前从未发生过的地方触发这个问题?
由于我是来这里寻找这个并且没有答案,所以我决定看一下代码。看起来 DataProtector.cs 使用应用程序名称(以及主要用途和特定用途)来创建 SHA 256 哈希。
由于散列是 one way street,因此将您想要的任何内容放在那里应该是非常安全的。我想越复杂越好,但应用程序的名称应该没问题。
希望这对其他过于偏执的人有所帮助。
在我们的 IdentityManager
class 中,我们有以下行:
protectionProvider = new DpapiDataProtectionProvider("OurProduct");
最后一个参数的含义是什么,它与网站在 IIS 上的设置方式有什么关系吗?
背景:
长期以来,我们一直在将具有自定义 IdentityManager
class 的 MVC5 站点部署到验证环境中,没有任何麻烦,现在我们在尝试重置用户密码时遇到以下问题:
System.Security.Cryptography.CryptographicException: The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread's user context, which may be the case when the thread is impersonating.
以下线程中描述了一些解决方案: Generating reset password token does not work in Azure Website
一切都位于同一台机器上:IIS、Sql 服务器、Firefox 测试浏览器。
不幸的是,我没有完全掌握这些概念,我正试图弄清楚测试环境是如何改变的,以便在以前从未发生过的地方触发这个问题?
由于我是来这里寻找这个并且没有答案,所以我决定看一下代码。看起来 DataProtector.cs 使用应用程序名称(以及主要用途和特定用途)来创建 SHA 256 哈希。
由于散列是 one way street,因此将您想要的任何内容放在那里应该是非常安全的。我想越复杂越好,但应用程序的名称应该没问题。
希望这对其他过于偏执的人有所帮助。