【发布时间】:2012-12-20 09:47:27
【问题描述】:
在创建 SessionCookies(FederatedAuthentication.SessionAuthenticationModule.WriteSessionTokenToCookie(sessionToken)) 时,如果我在配置文件中设置机器密钥设置,我在身份服务器 4.5(最新版本)中出现以下错误“加密操作期间发生错误” , 而 TempData 会在应用程序中丢失。以下是堆栈跟踪详细信息:
异常信息:
异常类型:CryptographicException
异常消息:加密操作期间发生错误。
在 System.Web.Security.Cryptography.HomogenizingCryptoServiceWrapper.HomogenizeErrors(Func2 func, Byte[] input)
at BrockAllen.CookieTempData.CookieTempDataProvider.LoadTempData(ControllerContext controllerContext) in c:\ballen\github\CookieTempData\45\BrockAllen.CookieTempData\CookieTempDataProvider.cs:line 37
at System.Web.Mvc.TempDataDictionary.Load(ControllerContext controllerContext, ITempDataProvider tempDataProvider)
at System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult1.Begin(AsyncCallback 回调,对象状态,Int32 超时)
在 System.Web.Mvc.Async.AsyncResultWrapper.Begin[TResult](AsyncCallback 回调,对象状态,BeginInvokeDelegate beginDelegate,EndInvokeDelegate1 endDelegate, Object tag, Int32 timeout)
at System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object state, BeginInvokeDelegate beginDelegate, EndInvokeDelegate endDelegate, Object tag)
at System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state)
at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.<BeginProcessRequest>b__2(AsyncCallback asyncCallback, Object asyncState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult1.Begin(AsyncCallback 回调,对象状态,Int32 超时)
在 System.Web.Mvc.Async.AsyncResultWrapper.Begin[TResult](AsyncCallback 回调,对象状态,BeginInvokeDelegate beginDelegate,EndInvokeDelegate`1 endDelegate,对象标记,Int32 超时)
在 System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback 回调,对象状态,BeginInvokeDelegate beginDelegate,EndInvokeDelegate endDelegate,对象标记)
在 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext,AsyncCallback 回调,对象状态)
在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)。
【问题讨论】:
标签: session-cookies claims-based-identity least-privilege