{"action":"created","issue":{"url":"https://api.github.com/repos/IdentityServer/IdentityServer4/issues/861","repository_url":"https://api.github.com/repos/IdentityServer/IdentityServer4","labels_url":"https://api.github.com/repos/IdentityServer/IdentityServer4/issues/861/labels{/name}","comments_url":"https://api.github.com/repos/IdentityServer/IdentityServer4/issues/861/comments","events_url":"https://api.github.com/repos/IdentityServer/IdentityServer4/issues/861/events","html_url":"https://github.com/IdentityServer/IdentityServer4/issues/861","id":211098491,"node_id":"MDU6SXNzdWUyMTEwOTg0OTE=","number":861,"title":"Changing the lifetime of the Identity Server cookie","user":{"login":"naeemsarfraz","id":1143865,"node_id":"MDQ6VXNlcjExNDM4NjU=","avatar_url":"https://avatars0.githubusercontent.com/u/1143865?v=4","gravatar_id":"","url":"https://api.github.com/users/naeemsarfraz","html_url":"https://github.com/naeemsarfraz","followers_url":"https://api.github.com/users/naeemsarfraz/followers","following_url":"https://api.github.com/users/naeemsarfraz/following{/other_user}","gists_url":"https://api.github.com/users/naeemsarfraz/gists{/gist_id}","starred_url":"https://api.github.com/users/naeemsarfraz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naeemsarfraz/subscriptions","organizations_url":"https://api.github.com/users/naeemsarfraz/orgs","repos_url":"https://api.github.com/users/naeemsarfraz/repos","events_url":"https://api.github.com/users/naeemsarfraz/events{/privacy}","received_events_url":"https://api.github.com/users/naeemsarfraz/received_events","type":"User","site_admin":false},"labels":[{"id":290038719,"node_id":"MDU6TGFiZWwyOTAwMzg3MTk=","url":"https://api.github.com/repos/IdentityServer/IdentityServer4/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-03-01T14:33:48Z","updated_at":"2018-10-11T20:06:15Z","closed_at":"2017-03-21T10:11:50Z","author_association":"CONTRIBUTOR","body":"The life of the Identity Server auth cookie is 10 hours, I want to change this. I've read [the documentation](http://docs.identityserver.io/en/release/topics/signin.html) around this but found things are a little different when you add AspNetIdentity into the mix.\r\n\r\nThe solution is to set the desired timeout period on the `IdentityOptions` object like so.\r\n\r\n```\r\npublic void ConfigureServices(IServiceCollection services)\r\n    ...\r\n\r\n    services.AddIdentity<IdentityUser, IdentityRole>(options => {\r\n        options.Cookies.ApplicationCookie.ExpireTimeSpan = TimeSpan.FromHours(1);\r\n    });\r\n\r\n    ...\r\n}\r\n```\r\n\r\nSo it seems like I don't need to add my own Cookie middleware. Does that seem right? If so I'll submit a PR to make an addition to the documentation if you're ok with that.\r\n\r\nP.S. Whilst trying to find a solution for this I tried to change the `IdentityServerOptions.Authentication.AuthenticationScheme` but found it had no effect because it was being set again in the `AddAspNetIdentity<IdentityUser>()` method. This method accepts a string to define the AuthenticationScheme as per the following example. Might also be useful to mention this in the docs too.\r\n\r\n```\r\npublic void ConfigureServices(IServiceCollection services)\r\n    ...\r\n\r\n    services\r\n        .AddIdentityServer(options => {\r\n            options.Authentication.AuthenticationScheme = \"myscheme\"; //pointless\r\n        })\r\n        .AddAspNetIdentity<IdentityUser>(\"myscheme\") //overwrites what was set above\r\n\r\n    ...\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/IdentityServer/IdentityServer4/issues/comments/429099740","html_url":"https://github.com/IdentityServer/IdentityServer4/issues/861#issuecomment-429099740","issue_url":"https://api.github.com/repos/IdentityServer/IdentityServer4/issues/861","id":429099740,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTA5OTc0MA==","user":{"login":"prisar","id":7943405,"node_id":"MDQ6VXNlcjc5NDM0MDU=","avatar_url":"https://avatars2.githubusercontent.com/u/7943405?v=4","gravatar_id":"","url":"https://api.github.com/users/prisar","html_url":"https://github.com/prisar","followers_url":"https://api.github.com/users/prisar/followers","following_url":"https://api.github.com/users/prisar/following{/other_user}","gists_url":"https://api.github.com/users/prisar/gists{/gist_id}","starred_url":"https://api.github.com/users/prisar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prisar/subscriptions","organizations_url":"https://api.github.com/users/prisar/orgs","repos_url":"https://api.github.com/users/prisar/repos","events_url":"https://api.github.com/users/prisar/events{/privacy}","received_events_url":"https://api.github.com/users/prisar/received_events","type":"User","site_admin":false},"created_at":"2018-10-11T20:06:15Z","updated_at":"2018-10-11T20:06:15Z","author_association":"NONE","body":"@justin I think it will work"}}
{"actor":{"display_login":"prisar"}}