{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Security/issues/1496","repository_url":"https://api.github.com/repos/aspnet/Security","labels_url":"https://api.github.com/repos/aspnet/Security/issues/1496/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Security/issues/1496/comments","events_url":"https://api.github.com/repos/aspnet/Security/issues/1496/events","html_url":"https://github.com/aspnet/Security/issues/1496","id":266220408,"number":1496,"title":"net core 2.0 -- cookie authentication not working","user":{"login":"plsft","id":13736152,"avatar_url":"https://avatars2.githubusercontent.com/u/13736152?v=4","gravatar_id":"","url":"https://api.github.com/users/plsft","html_url":"https://github.com/plsft","followers_url":"https://api.github.com/users/plsft/followers","following_url":"https://api.github.com/users/plsft/following{/other_user}","gists_url":"https://api.github.com/users/plsft/gists{/gist_id}","starred_url":"https://api.github.com/users/plsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plsft/subscriptions","organizations_url":"https://api.github.com/users/plsft/orgs","repos_url":"https://api.github.com/users/plsft/repos","events_url":"https://api.github.com/users/plsft/events{/privacy}","received_events_url":"https://api.github.com/users/plsft/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-10-17T17:52:58Z","updated_at":"2018-05-24T00:44:32Z","closed_at":"2017-10-19T21:10:30Z","author_association":"NONE","body":"AddCookieAuthentication() doesn't seem to work for me. I thought i added the correct packages. any thoughts? getting:\r\n\r\nInvalidOperationException: No IAuthenticationSignInHandler is configured to handle sign in for the scheme: Cookies\r\n\r\nwith following code:\r\n\r\n    public void ConfigureServices(IServiceCollection services)\r\n    {\r\n        services.AddAuthorization(o =>\r\n        {\r\n            o.AddPolicy(\"Users\", p => p.RequireClaim(\"Users\"));\r\n            o.AddPolicy(\"SuperUsers\", p => p.RequireClaim(\"SuperUsers\"));\r\n            o.AddPolicy(\"PlatformUsers\", p => p.RequireClaim(\"PlatformUsers\"));\r\n        });\r\n\r\n        services.AddAuthentication(options =>\r\n        {\r\n            options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;\r\n            options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;\r\n            options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme;\r\n            options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;\r\n        }).AddCookie(\"Cookieauth\", options =>\r\n        {\r\n            options.LoginPath = new PathString(\"/login\");\r\n            options.AccessDeniedPath = new PathString(\"/error?unauth\");\r\n        });\r\n\r\n        services.AddMvc();\r\n    }"},"comment":{"url":"https://api.github.com/repos/aspnet/Security/issues/comments/391548756","html_url":"https://github.com/aspnet/Security/issues/1496#issuecomment-391548756","issue_url":"https://api.github.com/repos/aspnet/Security/issues/1496","id":391548756,"user":{"login":"dennis3001","id":2040920,"avatar_url":"https://avatars2.githubusercontent.com/u/2040920?v=4","gravatar_id":"","url":"https://api.github.com/users/dennis3001","html_url":"https://github.com/dennis3001","followers_url":"https://api.github.com/users/dennis3001/followers","following_url":"https://api.github.com/users/dennis3001/following{/other_user}","gists_url":"https://api.github.com/users/dennis3001/gists{/gist_id}","starred_url":"https://api.github.com/users/dennis3001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennis3001/subscriptions","organizations_url":"https://api.github.com/users/dennis3001/orgs","repos_url":"https://api.github.com/users/dennis3001/repos","events_url":"https://api.github.com/users/dennis3001/events{/privacy}","received_events_url":"https://api.github.com/users/dennis3001/received_events","type":"User","site_admin":false},"created_at":"2018-05-24T00:44:32Z","updated_at":"2018-05-24T00:44:32Z","author_association":"NONE","body":"Still can't get this to work. Seems that when using Identity the cookie options are ignored. The options callback is not even firing:\r\n\r\n`services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).\r\n                AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, options =>\r\n                {\r\n                    // The line below  never get's fired ...\r\n                    options.Cookie.Name = \"SessionCookie\";\r\n                 });\r\n            \r\n            services.AddIdentity<ApplicationUser, IdentityRole>()\r\n            .AddEntityFrameworkStores<ApplicationDbContext>()\r\n            .AddDefaultTokenProviders();`"}}
{"actor":{"display_login":"dennis3001"}}