user1918328
user1918328

Reputation: 101

Error occurred during a cryptographic operation (In Latest version of Thinktecture Identity Server 4.5)

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.WrappedAsyncResult1.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.WrappedAsyncResult1.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

Answers (2)

Alexander Esser
Alexander Esser

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

Brock Allen
Brock Allen

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

Related Questions