Skip to content
This repository has been archived by the owner on Oct 17, 2018. It is now read-only.

CryptographicException when calling SignInManager.PasswordSiginAsync #50

Closed
kscott5 opened this issue Feb 16, 2015 · 1 comment
Closed

Comments

@kscott5
Copy link

kscott5 commented Feb 16, 2015

Any idea why I get this error?

An unhandled exception occurred while processing the request.
CryptographicException: Key not valid for use in specified state.

Microsoft.AspNet.Security.DataProtection.Cng.DpapiSecretSerializerHelper.UnprotectWithDpapiImpl(Byte* pbProtectedData, UInt32 cbProtectedData, Byte* pbOptionalEntropy, UInt32 cbOptionalEntropy)

Stack 
Query 
Cookies 
400 Headers 
Environment 
CryptographicException: Key not valid for use in specified state. 
Microsoft.AspNet.Security.DataProtection.Cng.DpapiSecretSerializerHelper.UnprotectWithDpapiImpl(Byte* pbProtectedData, UInt32 cbProtectedData, Byte* pbOptionalEntropy, UInt32 cbOptionalEntropy)
Microsoft.AspNet.Security.DataProtection.Cng.DpapiSecretSerializerHelper.UnprotectWithDpapi(Byte[] protectedSecret)
400 
Microsoft.AspNet.Security.DataProtection.XmlEncryption.DpapiXmlDecryptor.Decrypt(XElement encryptedElement)
Microsoft.AspNet.Security.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptorConfigurationXmlReader.FromXml(XElement element)
Microsoft.AspNet.Security.DataProtection.KeyManagement.XmlKeyManager.ParseKeyElement(XElement keyElement)
Microsoft.AspNet.Security.DataProtection.KeyManagem 400 ent.XmlKeyManager.GetAllKeys()
Microsoft.AspNet.Security.DataProtection.KeyManagement.KeyRingProvider.CreateCachedKeyRingInstanceUnderLock(DateTime utcNow, CachedKeyRing existingCachedKeyRing)
Microsoft.AspNet.Security.DataProtection.KeyManagement.KeyRingProvider.GetCurrentKeyRing()
Microsoft.AspNet.Security.DataProtection.KeyManagement.KeyRingBasedDataProtector.Protect(Byte[] unprotectedData)
400 
Microsoft.AspNet.Security.DataHandler.SecureDataFormat`1.Protect(TData data)
Microsoft.AspNet.Security.Cookies.CookieAuthenticationHandler.<ApplyResponseGrantAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwait 400 er.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNet.Security.Cookies.CookieAuthenticationHandler.ApplyResponseGrant()
Microsoft.AspNet.Security.Infrastructure.AuthenticationHandler.ApplyResponseCore()
Microsoft.AspNet.Security.Infrastructure.AuthenticationHandler.<ApplyResponse>b__55_0()
System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, B 400 oolean& initialized, Object& syncLock, Func`1 valueFactory)
Microsoft.AspNet.Security.Infrastructure.AuthenticationHandler.ApplyResponse()
Microsoft.AspNet.Security.Infrastructure.AuthenticationHandler.OnSendingHeaderCallback(Object state)
Microsoft.Net.Http.Server.Response.NotifyOnSendingHeaders()
Microsoft.Net.Http.Server.Response.ComputeHeaders(Boolean endOfRequest)
400 
Microsoft.Net.Http.Server.ResponseStream.ComputeLeftToWrite(Boolean endOfRequest)
Microsoft.Net.Http.Server.ResponseStream.Write(Byte[] buffer, Int32 offset, Int32 size)
Microsoft.AspNet.Mvc.DelegatingStream.Write(Byte[] buffer, Int32 offset, Int32 count)
System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
400 
System.IO.StreamWriter.Dispose(Boolean disposing)
System.IO.TextWriter.Dispose()
Microsoft.AspNet.Mvc.JsonOutputFormatter.WriteResponseBodyAsync(OutputFormatterContext context)
Microsoft.AspNet.Mvc.OutputFormatter.<WriteAsync>d__12.MoveNext()
--- End of stack trace from previous location wh 400 ere exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNet.Mvc.JsonResult.<ExecuteResultAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
400 
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNet.Mvc.FilterActionInvoker.<InvokeResultAsync>d__44.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNet.Mvc.FilterActionInvoker.<InvokeResultFilterAsync>d__43.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
400 
Microsoft.AspNet.Mvc.FilterActionInvoker.<InvokeAllResultFiltersAsync>d__42.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwai 400 ter.ValidateEnd(Task task)
Microsoft.AspNet.Mvc.FilterActionInvoker.<InvokeResourceFilterAsync>d__37.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
Microsoft.AspNet.Mvc.FilterActionInvoker.<InvokeAsync>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
400 
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNet.Mvc.MvcRouteHandler.<InvokeActionAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNet.Mvc.MvcRouteHandler.<RouteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime. 400 CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNet.Routing.Template.TemplateRoute.<RouteAsync>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)< 400 /h3> 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNet.Mvc.Routing.AttributeRoute.<RouteAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
400 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNet.Routing.RouteCollection.<RouteAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
400 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNet.Builder.RouterMiddleware.<Invoke>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaite 400 r.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNet.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
Microsoft.AspNet.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__11.MoveNext()
--- End of stack trace from previous location where exceptio 400 n was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNet.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
400 
Microsoft.AspNet.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
400 
Microsoft.AspNet.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
Microsoft.AspNet.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNet.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
400 
Microsoft.AspNet.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNet.Securi 400 ty.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
Microsoft.AspNet.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNon 400 Success(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNet.Diagnostics.ErrorPageMiddleware.<Invoke>d__4.MoveNext()
No QueryString data.

Variable 400  Value 
Accept application/json, text/plain, */* 
Accept-Encoding gzip, deflate 
Accept-Language en-US,en;q=0.8 
Connection keep-alive 
400  Content-Length 387 
Content-Type application/json;charset=UTF-8 
Host localhost:8080 
Origin http://localhost:8080 
Referer http://localhost:8080/ 400  
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36 

0 
@GrabYourPitchforks
Copy link
Contributor

Dupe of #51.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants