{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Security/issues/1407","repository_url":"https://api.github.com/repos/aspnet/Security","labels_url":"https://api.github.com/repos/aspnet/Security/issues/1407/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Security/issues/1407/comments","events_url":"https://api.github.com/repos/aspnet/Security/issues/1407/events","html_url":"https://github.com/aspnet/Security/issues/1407","id":255301635,"number":1407,"title":"\"WinHttpException: The connection with the server was terminated abnormally\" on first sign on with Open Id Connect","user":{"login":"darickc","id":14807076,"avatar_url":"https://avatars0.githubusercontent.com/u/14807076?v=4","gravatar_id":"","url":"https://api.github.com/users/darickc","html_url":"https://github.com/darickc","followers_url":"https://api.github.com/users/darickc/followers","following_url":"https://api.github.com/users/darickc/following{/other_user}","gists_url":"https://api.github.com/users/darickc/gists{/gist_id}","starred_url":"https://api.github.com/users/darickc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darickc/subscriptions","organizations_url":"https://api.github.com/users/darickc/orgs","repos_url":"https://api.github.com/users/darickc/repos","events_url":"https://api.github.com/users/darickc/events{/privacy}","received_events_url":"https://api.github.com/users/darickc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-09-05T14:41:47Z","updated_at":"2017-09-06T19:06:12Z","closed_at":null,"author_association":"NONE","body":"I will get a \"WinHttpException: The connection with the server was terminated abnormally\" error the first time the CallbackPath is run.  If I refresh the browser or even close the browser and try again, this does not happen.  It is only after it runs for the first time.  I can recycle to the app pool and it will give the error the first time it runs.  This does not happen when running against the full .Net framework either.\r\n\r\nI have created my own middleware, inheriting from the open id connect middleware.  The only change I made was in the OpenIdConnectHandler class I overwrote the RedeemAuthorizationCodeAsync method to catch the error and to retry it, which works:\r\n\r\n`\r\nprotected override async Task<OpenIdConnectMessage> RedeemAuthorizationCodeAsync(\r\n            OpenIdConnectMessage tokenEndpointRequest)\r\n        {\r\n            try\r\n            {\r\n                return await base.RedeemAuthorizationCodeAsync(tokenEndpointRequest);\r\n            }\r\n            catch\r\n            {\r\n                return await base.RedeemAuthorizationCodeAsync(tokenEndpointRequest);\r\n            }\r\n        }\r\n`\r\n\r\nWhy would this be throwing an error the first run?\r\nThanks"},"comment":{"url":"https://api.github.com/repos/aspnet/Security/issues/comments/327583369","html_url":"https://github.com/aspnet/Security/issues/1407#issuecomment-327583369","issue_url":"https://api.github.com/repos/aspnet/Security/issues/1407","id":327583369,"user":{"login":"Tratcher","id":1821173,"avatar_url":"https://avatars3.githubusercontent.com/u/1821173?v=4","gravatar_id":"","url":"https://api.github.com/users/Tratcher","html_url":"https://github.com/Tratcher","followers_url":"https://api.github.com/users/Tratcher/followers","following_url":"https://api.github.com/users/Tratcher/following{/other_user}","gists_url":"https://api.github.com/users/Tratcher/gists{/gist_id}","starred_url":"https://api.github.com/users/Tratcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tratcher/subscriptions","organizations_url":"https://api.github.com/users/Tratcher/orgs","repos_url":"https://api.github.com/users/Tratcher/repos","events_url":"https://api.github.com/users/Tratcher/events{/privacy}","received_events_url":"https://api.github.com/users/Tratcher/received_events","type":"User","site_admin":false},"created_at":"2017-09-06T19:06:12Z","updated_at":"2017-09-06T19:06:12Z","author_association":"MEMBER","body":"Possibly related: https://github.com/dotnet/corefx/issues/21612"}}
{"actor":{"display_login":"Tratcher"}}