azure中的Virto Commerce加密异常



在努力将virto commerce成功部署到Azure之后,在为新用户激活电子邮件确认之后,我不断遇到加密异常:

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.
at System.Security.Cryptography.ProtectedData.Protect(Byte[] userData, Byte[] optionalEntropy, DataProtectionScope scope)
   at VirtoCommerce.Web.Client.Providers.CookieTempDataProvider.Protect(Byte[] data) in c:UsersTiagoDocumentsxpmarketplacesrcExtensionsClientCommerceWebClientProvidersCookieTempDataProvider.cs:line 91
   at VirtoCommerce.Web.Client.Providers.CookieTempDataProvider.SaveTempData(ControllerContext controllerContext, IDictionary`2 values) in c:UsersTiagoDocumentsxpmarketplacesrcExtensionsClientCommerceWebClientProvidersCookieTempDataProvider.cs:line 28
   at System.Web.Mvc.TempDataDictionary.Save(ControllerContext controllerContext, ITempDataProvider tempDataProvider)
   at System.Web.Mvc.Controller.PossiblySaveTempData()
   at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
   at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult)
   at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
   at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
   at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
   at System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)

在谷歌上搜索了异常文本后,我遇到了一些指南,暗示我应该在IIS AppPool中将"加载用户配置文件"设置为True,但我试图这样做,结果发现默认情况下它已经为True。

这是其中一个来源https://social.msdn.microsoft.com/Forums/vstudio/en-US/ad1f7367-7727-4b1a-a190-840ff4ed5709/adfs-20-sso-the-data-protection-operation-was-unsuccessful?forum=Geneva

EDIT:当系统生成任何令牌(帐户激活、重置密码)时,会引发异常。

更新了CookieTempDataProvider类,该类使用MachineKey而不是ProtectedData来加密和解密cookie。这应该能解决问题。我将重建我们的测试和演示环境,并检查它是否有效。但是,您可以下载完整的源代码,也可以只下载该类并重新编译。它应该能解决你的问题。

相关内容

  • 没有找到相关文章

最新更新