gpt4 book ai didi

azure - azure 中的 Virto Commerce 加密异常

转载 作者:行者123 更新时间:2023-12-04 07:37:44 28 4
gpt4 key购买 nike

在努力将 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:\Users\Tiago\Documents\xpmarketplace\src\Extensions\Client\CommerceWebClient\Providers\CookieTempDataProvider.cs:line 91
at VirtoCommerce.Web.Client.Providers.CookieTempDataProvider.SaveTempData(ControllerContext controllerContext, IDictionary`2 values) in c:\Users\Tiago\Documents\xpmarketplace\src\Extensions\Client\CommerceWebClient\Providers\CookieTempDataProvider.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

编辑:当系统生成任何 token (帐户激活、重置密码)时会引发异常。

最佳答案

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

关于azure - azure 中的 Virto Commerce 加密异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29125028/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com