Reputation: 101
I am getting following Error"Error occurred during a cryptographic operation" in identity server 4.5 (latest Release) when creating SessionCookies( FederatedAuthentication.SessionAuthenticationModule.WriteSessionTokenToCookie(sessionToken)) After lot of R&d if i set machine key settings in config file, than TempData will lost in application. Following is the Stack Trace detail:
Exception information:
Exception type: CryptographicException
Exception message: Error occurred during a cryptographic operation.
at 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.WrappedAsyncResult
1.Begin(AsyncCallback callback, Object state, Int32 timeout)
at System.Web.Mvc.Async.AsyncResultWrapper.Begin[TResult](AsyncCallback callback, Object state, 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.WrappedAsyncResult
1.Begin(AsyncCallback callback, Object state, Int32 timeout)
at System.Web.Mvc.Async.AsyncResultWrapper.Begin[TResult](AsyncCallback callback, Object state, BeginInvokeDelegate beginDelegate, EndInvokeDelegate`1 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.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously).
Upvotes: 0
Views: 3706
Reputation: 31
I got the same error after re-installing the Identity Server. Deleting the cookies in the browser did the trick for me.
Upvotes: 2
Reputation: 7435
Can you elaborate on what you did to cause this exception? Setting the <machineKey> works fine in my tests. Also, the IdentityServer issue tracker might be a better place for these sorts of issues:
https://github.com/thinktecture/Thinktecture.IdentityServer.v2/issues
Upvotes: 0