{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Security/issues/248","labels_url":"https://api.github.com/repos/aspnet/Security/issues/248/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Security/issues/248/comments","events_url":"https://api.github.com/repos/aspnet/Security/issues/248/events","html_url":"https://github.com/aspnet/Security/issues/248","id":74489204,"number":248,"title":"Breaking changes in Authentication / Authorization","user":{"login":"sandorfr","id":2660262,"avatar_url":"https://avatars.githubusercontent.com/u/2660262?v=3","gravatar_id":"","url":"https://api.github.com/users/sandorfr","html_url":"https://github.com/sandorfr","followers_url":"https://api.github.com/users/sandorfr/followers","following_url":"https://api.github.com/users/sandorfr/following{/other_user}","gists_url":"https://api.github.com/users/sandorfr/gists{/gist_id}","starred_url":"https://api.github.com/users/sandorfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandorfr/subscriptions","organizations_url":"https://api.github.com/users/sandorfr/orgs","repos_url":"https://api.github.com/users/sandorfr/repos","events_url":"https://api.github.com/users/sandorfr/events{/privacy}","received_events_url":"https://api.github.com/users/sandorfr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-05-08T20:43:47Z","updated_at":"2015-05-08T23:08:23Z","closed_at":null,"body":"There are a lot of breaking changes in that area. They look amazing but I'm really struggling with them. Is there any design notes about how it works. \r\n\r\nHere is some details about what I'm struggling with ( http://forums.asp.net/t/2048628.aspx?Struggling+with+the+beta4+Authentication+Authorization+changes )\r\n\r\n--\r\n\r\nHere what I currently have :\r\n* A Middleware which is overriding CreateHandler and return my custom authentication handler\r\n* A Custom authentication handler and its options\r\n\r\nI'm configuring it that way :\r\n\r\nIn ConfigureServices\r\n```csharp\r\nservices.AddAuthorization();\r\nservices.ConfigureAuthorization(options => options.AddPolicy(JWTAuthenticationDefaults.AuthenticationType,\r\n                new AuthorizationPolicyBuilder().AddAuthenticationSchemes(JWTAuthenticationDefaults.AuthenticationType).Build()));\r\n\r\n```\r\n\r\nIn Configure\r\n```csharp\r\napp.UseJWTAuthentication(options => {\r\n                options.MasterKey = Configuration.Get(\"masterKey\");\r\n            }, JWTAuthenticationDefaults.AuthenticationType);\r\n```\r\n\r\n**First issue** : currently, it successfully steps in my custom handler `AuthenticateCoreAsync`, I return a valid ticket, but `ApplyResponseChallenge` is called every time.\r\n\r\n**Another thing** bothers me, If my policy name differs from my authenticationscheme it fails with `InvalidOperationException: The following authentication scheme was not accepted: customJWT` and I can't figure out why.\r\n\r\nAnd **the last strange thing** ApplyResponseChallenge is called twice per request.           "},"comment":{"url":"https://api.github.com/repos/aspnet/Security/issues/comments/100391430","html_url":"https://github.com/aspnet/Security/issues/248#issuecomment-100391430","issue_url":"https://api.github.com/repos/aspnet/Security/issues/248","id":100391430,"user":{"login":"sandorfr","id":2660262,"avatar_url":"https://avatars.githubusercontent.com/u/2660262?v=3","gravatar_id":"","url":"https://api.github.com/users/sandorfr","html_url":"https://github.com/sandorfr","followers_url":"https://api.github.com/users/sandorfr/followers","following_url":"https://api.github.com/users/sandorfr/following{/other_user}","gists_url":"https://api.github.com/users/sandorfr/gists{/gist_id}","starred_url":"https://api.github.com/users/sandorfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandorfr/subscriptions","organizations_url":"https://api.github.com/users/sandorfr/orgs","repos_url":"https://api.github.com/users/sandorfr/repos","events_url":"https://api.github.com/users/sandorfr/events{/privacy}","received_events_url":"https://api.github.com/users/sandorfr/received_events","type":"User","site_admin":false},"created_at":"2015-05-08T23:08:23Z","updated_at":"2015-05-08T23:08:23Z","body":"Ok, thanks I'm going to do some test following that path and triple check everything again :). I'll keep you updated."}}