{"action":"opened","issue":{"url":"https://api.github.com/repos/IdentityServer/IdentityServer3/issues/1564","labels_url":"https://api.github.com/repos/IdentityServer/IdentityServer3/issues/1564/labels{/name}","comments_url":"https://api.github.com/repos/IdentityServer/IdentityServer3/issues/1564/comments","events_url":"https://api.github.com/repos/IdentityServer/IdentityServer3/issues/1564/events","html_url":"https://github.com/IdentityServer/IdentityServer3/issues/1564","id":92665072,"number":1564,"title":"TaskCanceledException/OperationCanceledException questions","user":{"login":"AdamDotNet","id":8978001,"avatar_url":"https://avatars.githubusercontent.com/u/8978001?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamDotNet","html_url":"https://github.com/AdamDotNet","followers_url":"https://api.github.com/users/AdamDotNet/followers","following_url":"https://api.github.com/users/AdamDotNet/following{/other_user}","gists_url":"https://api.github.com/users/AdamDotNet/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamDotNet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamDotNet/subscriptions","organizations_url":"https://api.github.com/users/AdamDotNet/orgs","repos_url":"https://api.github.com/users/AdamDotNet/repos","events_url":"https://api.github.com/users/AdamDotNet/events{/privacy}","received_events_url":"https://api.github.com/users/AdamDotNet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-02T15:28:01Z","updated_at":"2015-07-02T15:28:01Z","closed_at":null,"body":"Hi, I've been using IdentityServer since some of the first beta builds. Great stuff, thanks for making it! But I have a logger that emails about unhandled exceptions, and while these exceptions seem to be harmless, it's a lot of emails we don't want to get. Here's the story.\r\n\r\nThe questions: The authorize and checksession endpoints tend to throw exceptions that the user apparently doesn't notice, but I would like to understand what is happening so we can prevent getting tons of useless emails. Also, one of my stack traces contains a reference to InMemory*Store and I have setup Entity Framework stores, so I don't know why the in memory stuff is getting called. Also, I thought .Net used TaskCanceledException to simply stop a task, not bubble up an exception. Why is there a reference to the in memory stuff? What causes these cancellations? Thanks for anyone that can help!\r\n\r\nSetup\r\n\r\nNuget version = 1.6.1\r\n\r\nHere's the relevant part of my identity configuration class:\r\n```C#\r\nprivate static IdentityServerServiceFactory Factory()\r\n{\r\n    IdentityServerServiceFactory factory = new IdentityServerServiceFactory();\r\n    EntityFrameworkServiceOptions efOptions = new EntityFrameworkServiceOptions { ConnectionString = ApplicationConstants.DbConnectionStringName };\r\n    factory.UserService = new Registration<IUserService>(_ => UserService());\r\n    factory.RegisterClientStore(efOptions);\r\n    factory.RegisterScopeStore(efOptions);\r\n    factory.RegisterOperationalServices(efOptions);\r\n    factory.RegisterConfigurationServices(efOptions);\r\n    new TokenCleanup(efOptions).Start();\r\n    factory.ViewService = new Registration<IViewService>(typeof(SawtoothViewService));\r\n    factory.LocalizationService = new Registration<ILocalizationService>(typeof(SawtoothLocalizationService));\r\n    return factory;\r\n}\r\n```\r\n\r\nMy middleware to catch unhandled exceptions:\r\n```C#\r\nprivate readonly bool isCustomErrorEnabled;\r\n\r\npublic SawtoothHandleErrorMiddleware(OwinMiddleware next)\r\n    : base(next)\r\n{\r\n    isCustomErrorEnabled = HttpContext.Current.IsCustomErrorEnabled;\r\n}\r\n\r\npublic override async Task Invoke(IOwinContext context)\r\n{\r\n    SawtoothHandleErrorInfo handleErrorInfo = null;\r\n\r\n    try\r\n    {\r\n        await Next.Invoke(context);\r\n    }\r\n    catch (Exception ex)\r\n    {\r\n        Uri requestedUrl = context.Request.Uri;\r\n        SawtoothUser user = GetUser(context);\r\n        if (user != null)\r\n        {\r\n            Trace.Write(TraceLevel.Error, user.Id, ex, \"User '{0}' got an exception visiting URL {1}.\", user.Email, requestedUrl);\r\n        }\r\n        else\r\n        {\r\n            Trace.Write(TraceLevel.Error, ex, \"An unauthenticated user got an exception visiting URL {0}.\", requestedUrl);\r\n        }\r\n\r\n        if (isCustomErrorEnabled)\r\n        {\r\n            handleErrorInfo = new SawtoothHandleErrorInfo { Exception = ex, RequestedUrl = requestedUrl, IsOwin = true };\r\n        }\r\n        else\r\n        {\r\n            throw;\r\n        }\r\n    }\r\n    \r\n    if (handleErrorInfo != null)\r\n    {\r\n        context.Response.StatusCode = 500;\r\n        ErrorController errorController = FakeControllerFactory.Create<ErrorController>();\r\n        await context.Response.WriteAsync(errorController.RenderViewToBytes(\"Error\", handleErrorInfo));\r\n    }\r\n}\r\n```\r\n\r\nAnd finally, some stack traces.\r\n\r\nOperationCanceledException\r\n\r\nMessage: An unauthenticated user got an exception visiting URL https://account.sawtoothsoftware.com/Identity/connect/authorize?client_id=EF240QEU5SLMT3ULE4UT23FDZVIGIKNFK1O7JBL6ITBWVZWE&redirect_uri=https:%2f%2faccount.sawtoothsoftware.com&response_mode=form_post&response_type=id_token+token&scope=openid+email+contact_id+contact_api&state=OpenIdConnect.AuthenticationProperties%3dIPkLFR3GRoMz92xjakAFZhBE82O2KbtFe17rh2ibJBP7pjV08sBVMj1VN0X7gkqyZQdUuzq6YjCcNednkNeDuyP6loGV2BYth4fKQau5T27sXst32UeVRgbH7VhHWeIdmC73gMgC31GDVB7ttRrnE53J82q220QWo8aXxRREtuiovCFNEW9rDXpNPtJQbuCGmuPEjKGGpdj78Mr6Jh4IxB_XlZPH7yItGtlitNVwsV4&nonce=635713467898207951.OWZkZWQwMjAtYTAzNy00MGYyLThjNjQtZTg5MTU3ZjVmOGRkN2ZhM2QyZjYtNGY2Mi00ZmFhLWEzM2EtYWMxNzZkZjQxYzBi.\r\n\r\nException: System.OperationCanceledException: The operation was canceled.\r\n   at System.Threading.CancellationToken.ThrowOperationCanceledException()\r\n   at System.Web.Http.Owin.HttpMessageHandlerAdapter.<SendResponseContentAsync>d__20.MoveNext() in **c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\Services\\InMemory\\InMemoryClientStore.cs:line 0**\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Owin.HttpMessageHandlerAdapter.<InvokeCore>d__0.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\Services\\InMemory\\InMemoryClientStore.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Owin.UseCookieAuthenticationExtension.<>c__DisplayClass6.<<ConfigureCookieAuthentication>b__4>d__8.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\Configuration\\AppBuilderExtensions\\ConfigureCookieAuthenticationExtension.cs:line 96\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__0.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\Services\\InMemory\\InMemoryClientStore.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__0.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\Services\\InMemory\\InMemoryClientStore.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__0.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\Services\\InMemory\\InMemoryClientStore.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Owin.Cors.CorsMiddleware.<Invoke>d__0.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\Services\\InMemory\\InMemoryClientStore.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Thinktecture.IdentityServer.Core.Configuration.Hosting.AutofacContainerMiddleware.<Invoke>d__4.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\Configuration\\Hosting\\AutofacContainerMiddleware.cs:line 62\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Owin.ConfigureIdentityServerBaseUrlExtension.<>c__DisplayClass1.<<ConfigureIdentityServerBaseUrl>b__0>d__3.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\Configuration\\AppBuilderExtensions\\ConfigureIdentityServerBaseUrlExtension.cs:line 43\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Owin.ConfigureRequestIdExtension.<<ConfigureRequestId>b__0>d__2.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\Configuration\\AppBuilderExtensions\\ConfigureRequestIdExtension.cs:line 37\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Thinktecture.IdentityServer.Core.Configuration.Hosting.RequireSslMiddleware.<Invoke>d__0.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\Configuration\\Hosting\\RequireSslMiddleware.cs:line 48\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Owin.Mapping.MapMiddleware.<Invoke>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at SawtoothOpenId.UnauthorizedRedirectUri.SetUnauthorizedRedirectMiddleware.<Invoke>d__0.MoveNext() in c:\\Source\\SawtoothAccount\\Milestone2\\SawtoothOpenId.UnauthorizedRedirectUri\\SetUnauthorizedRedirectMiddleware.cs:line 39\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Owin.HttpMessageHandlerAdapter.<InvokeCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Thinktecture.IdentityServer.AccessTokenValidation.ScopeRequirementMiddleware.<Invoke>d__0.MoveNext() in c:\\etc\\Dropbox\\identity\\IdentityServer3\\AccessTokenValidation\\source\\AccessTokenValidation\\ScopeRequirementMiddleware.cs:line 44\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNet.Identity.Owin.IdentityFactoryMiddleware`2.<Invoke>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNet.Identity.Owin.IdentityFactoryMiddleware`2.<Invoke>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at SawtoothAccount.Filters.SawtoothHandleErrorMiddleware.<Invoke>d__1.MoveNext() in c:\\Source\\SawtoothAccount\\Milestone2\\SawtoothAccount\\Filters\\SawtoothHandleErrorMiddleware.cs:line 30\r\n\r\nTaskCanceledException\r\n\r\nMessage: An unauthenticated user got an exception visiting URL https://stagingaccount.sawtoothsoftware.com/Identity/connect/checksession.\r\n\r\nException: System.Threading.Tasks.TaskCanceledException: A task was canceled.\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\ResponseHandling\\AuthorizeResponseGenerator.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\ResponseHandling\\AuthorizeResponseGenerator.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\ResponseHandling\\AuthorizeResponseGenerator.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Owin.PassiveAuthenticationMessageHandler.<SendAsync>d__0.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\ResponseHandling\\AuthorizeResponseGenerator.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.HttpServer.<SendAsync>d__0.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\ResponseHandling\\AuthorizeResponseGenerator.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.Owin.HttpMessageHandlerAdapter.<InvokeCore>d__0.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\ResponseHandling\\AuthorizeResponseGenerator.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Owin.UseCookieAuthenticationExtension.<>c__DisplayClass6.<<ConfigureCookieAuthentication>b__4>d__8.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\Configuration\\AppBuilderExtensions\\ConfigureCookieAuthenticationExtension.cs:line 96\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__0.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\ResponseHandling\\AuthorizeResponseGenerator.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__0.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\ResponseHandling\\AuthorizeResponseGenerator.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__0.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\ResponseHandling\\AuthorizeResponseGenerator.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Owin.Cors.CorsMiddleware.<Invoke>d__0.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\ResponseHandling\\AuthorizeResponseGenerator.cs:line 0\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Owin.OwinExtensions.<>c__DisplayClass2.<<UseAutofacMiddleware>b__0>d__7.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\Internal\\Autofac.Integration.Owin\\AutofacAppBuilderExtensions.cs:line 66\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Owin.ConfigureIdentityServerBaseUrlExtension.<>c__DisplayClass1.<<ConfigureIdentityServerBaseUrl>b__0>d__3.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\Configuration\\AppBuilderExtensions\\ConfigureIdentityServerBaseUrlExtension.cs:line 43\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Owin.ConfigureRequestIdExtension.<<ConfigureRequestId>b__0>d__2.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\Configuration\\AppBuilderExtensions\\ConfigureRequestIdExtension.cs:line 37\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Thinktecture.IdentityServer.Core.Configuration.Hosting.RequireSslMiddleware.<Invoke>d__0.MoveNext() in c:\\ballen\\github\\identity\\IdSrv3\\IdentityServer3\\source\\Core\\Configuration\\Hosting\\RequireSslMiddleware.cs:line 48\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Owin.Mapping.MapMiddleware.<Invoke>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at SawtoothOpenId.UnauthorizedRedirectUri.SetUnauthorizedRedirectMiddleware.<Invoke>d__0.MoveNext() in c:\\Source\\TFS\\SawtoothAccount\\MainBranch\\SawtoothOpenId.UnauthorizedRedirectUri\\SetUnauthorizedRedirectMiddleware.cs:line 39\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Owin.HttpMessageHandlerAdapter.<InvokeCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Thinktecture.IdentityServer.AccessTokenValidation.ScopeRequirementMiddleware.<Invoke>d__0.MoveNext() in c:\\etc\\Dropbox\\identity\\IdentityServer3\\AccessTokenValidation\\source\\AccessTokenValidation\\ScopeRequirementMiddleware.cs:line 44\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNet.Identity.Owin.IdentityFactoryMiddleware`2.<Invoke>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNet.Identity.Owin.IdentityFactoryMiddleware`2.<Invoke>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at SawtoothAccount.Filters.SawtoothHandleErrorMiddleware.<Invoke>d__1.MoveNext() in c:\\Source\\TFS\\SawtoothAccount\\MainBranch\\SawtoothAccount\\Filters\\SawtoothHandleErrorMiddleware.cs:line 30\r\n"}}