【发布时间】:2016-04-06 09:48:23
【问题描述】:
在我们的IdentityManager 类中,我们有以下行:
protectionProvider = new DpapiDataProtectionProvider("OurProduct");
最后一个参数的含义是什么,它与站点在 IIS 上的设置方式有什么关系吗?
背景:
很长一段时间以来,我们一直在轻松地将具有自定义 IdentityManager 类的 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 Server、Firefox 测试浏览器。
很遗憾,我没有完全掌握这些概念,我正试图弄清楚测试环境是如何变化的,以便在以前从未发生过的情况下触发这个问题?
【问题讨论】:
-
ps。我们通过更改目标机器上的 IIS 设置解决了这个问题。找到应用程序池,打开 Advanced Settings 并将 Load User Profile 更改为 true。我不会用这个作为这个问题的答案,因为那不是问题。
标签: c# asp.net-identity owin