{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/AspNetCore/issues/9407","repository_url":"https://api.github.com/repos/aspnet/AspNetCore","labels_url":"https://api.github.com/repos/aspnet/AspNetCore/issues/9407/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/AspNetCore/issues/9407/comments","events_url":"https://api.github.com/repos/aspnet/AspNetCore/issues/9407/events","html_url":"https://github.com/aspnet/AspNetCore/issues/9407","id":433582815,"node_id":"MDU6SXNzdWU0MzM1ODI4MTU=","number":9407,"title":"Dotnet Core cookies are getting expired within 5 minutes with WSFederation and SSO","user":{"login":"sankp","id":9613276,"node_id":"MDQ6VXNlcjk2MTMyNzY=","avatar_url":"https://avatars0.githubusercontent.com/u/9613276?v=4","gravatar_id":"","url":"https://api.github.com/users/sankp","html_url":"https://github.com/sankp","followers_url":"https://api.github.com/users/sankp/followers","following_url":"https://api.github.com/users/sankp/following{/other_user}","gists_url":"https://api.github.com/users/sankp/gists{/gist_id}","starred_url":"https://api.github.com/users/sankp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sankp/subscriptions","organizations_url":"https://api.github.com/users/sankp/orgs","repos_url":"https://api.github.com/users/sankp/repos","events_url":"https://api.github.com/users/sankp/events{/privacy}","received_events_url":"https://api.github.com/users/sankp/received_events","type":"User","site_admin":false},"labels":[{"id":1118663032,"node_id":"MDU6TGFiZWwxMTE4NjYzMDMy","url":"https://api.github.com/repos/aspnet/AspNetCore/labels/area-security","name":"area-security","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2019-04-16T04:51:49Z","updated_at":"2019-04-18T16:54:10Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI have aspnet core 2.2 mvc application which is also using web api. I am using WSFederation Security with SSO. Login and Cookies are working fine with this but after 5 mins my cookies are getting expired somehow and my web api calls turns into 302 response because SSO redirects.\r\nHow can I make my cookie valid for longer period of time. I have tried different options available but nothing seem to be working.\r\n\r\nHere is my code.\r\n\r\n`services.Configure<CookiePolicyOptions>(options =>\r\n                {                    \r\n                    options.CheckConsentNeeded = context => true;\r\n                    options.MinimumSameSitePolicy = SameSiteMode.None;                   \r\n                });\r\n\r\n                services.AddAuthentication(sharedOptions =>\r\n                {\r\n                    sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;\r\n                    sharedOptions.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;\r\n                    sharedOptions.DefaultChallengeScheme = WsFederationDefaults.AuthenticationScheme;\r\n                })\r\n\r\n                .AddWsFederation(options =>\r\n                {\r\n                    // Set the Metadata Address\r\n                    options.MetadataAddress = requestUri.AbsoluteUri;\r\n                    // Set the WS-Federation realm.\r\n                    options.Wtrealm = pingFederateSettings.Wtrealm;\r\n                })\r\n\r\n                .AddCookie(p =>\r\n                {\r\n                    p.SlidingExpiration = true;\r\n                    p.Events.OnSigningIn = (context) =>\r\n                    {\r\n                        context.CookieOptions.Expires = DateTimeOffset.UtcNow.AddDays(30);\r\n                        return Task.CompletedTask;\r\n                    };\r\n                    p.Events.OnRedirectToAccessDenied = (context) =>\r\n                    {                        \r\n                        return Task.CompletedTask;\r\n                    };                    \r\n                    p.Events.OnValidatePrincipal = (context) =>\r\n                    {\r\n                        return Task.CompletedTask;\r\n                    };\r\n                });\r\n`"},"comment":{"url":"https://api.github.com/repos/aspnet/AspNetCore/issues/comments/484590638","html_url":"https://github.com/aspnet/AspNetCore/issues/9407#issuecomment-484590638","issue_url":"https://api.github.com/repos/aspnet/AspNetCore/issues/9407","id":484590638,"node_id":"MDEyOklzc3VlQ29tbWVudDQ4NDU5MDYzOA==","user":{"login":"sankp","id":9613276,"node_id":"MDQ6VXNlcjk2MTMyNzY=","avatar_url":"https://avatars0.githubusercontent.com/u/9613276?v=4","gravatar_id":"","url":"https://api.github.com/users/sankp","html_url":"https://github.com/sankp","followers_url":"https://api.github.com/users/sankp/followers","following_url":"https://api.github.com/users/sankp/following{/other_user}","gists_url":"https://api.github.com/users/sankp/gists{/gist_id}","starred_url":"https://api.github.com/users/sankp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sankp/subscriptions","organizations_url":"https://api.github.com/users/sankp/orgs","repos_url":"https://api.github.com/users/sankp/repos","events_url":"https://api.github.com/users/sankp/events{/privacy}","received_events_url":"https://api.github.com/users/sankp/received_events","type":"User","site_admin":false},"created_at":"2019-04-18T16:54:10Z","updated_at":"2019-04-18T16:54:10Z","author_association":"NONE","body":"Thanks @Tratcher for your help. We don't provide login or logout functionality. It's all handled by SSO site. so I am good for now."}}
{"actor":{"display_login":"sankp"}}