{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Security/issues/591","labels_url":"https://api.github.com/repos/aspnet/Security/issues/591/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Security/issues/591/comments","events_url":"https://api.github.com/repos/aspnet/Security/issues/591/events","html_url":"https://github.com/aspnet/Security/issues/591","id":119390037,"number":591,"title":"Obtain dependencies through RequestServices, not through options","user":{"login":"tugberkugurlu","id":328122,"avatar_url":"https://avatars.githubusercontent.com/u/328122?v=3","gravatar_id":"","url":"https://api.github.com/users/tugberkugurlu","html_url":"https://github.com/tugberkugurlu","followers_url":"https://api.github.com/users/tugberkugurlu/followers","following_url":"https://api.github.com/users/tugberkugurlu/following{/other_user}","gists_url":"https://api.github.com/users/tugberkugurlu/gists{/gist_id}","starred_url":"https://api.github.com/users/tugberkugurlu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tugberkugurlu/subscriptions","organizations_url":"https://api.github.com/users/tugberkugurlu/orgs","repos_url":"https://api.github.com/users/tugberkugurlu/repos","events_url":"https://api.github.com/users/tugberkugurlu/events{/privacy}","received_events_url":"https://api.github.com/users/tugberkugurlu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-29T21:36:07Z","updated_at":"2015-11-30T10:51:50Z","closed_at":null,"body":"I can see that dependencies like [`ITicketStore`](https://github.com/aspnet/Security/blob/409b50269a9d85618a31f84a3ffc2868abb3eeea/src/Microsoft.AspNet.Authentication.Cookies/ITicketStore.cs), [`ISystemClock`](https://github.com/aspnet/Security/blob/409b50269a9d85618a31f84a3ffc2868abb3eeea/src/Microsoft.AspNet.Authentication/ISystemClock.cs) are [being set through the options](https://github.com/aspnet/Security/blob/409b50269a9d85618a31f84a3ffc2868abb3eeea/src/Microsoft.AspNet.Authentication.Cookies/CookieAuthenticationOptions.cs#L152) and I am not sure why they are not being set and requested through the [RequestServices](https://github.com/aspnet/HttpAbstractions/blob/67aa2546a87f0617005e6f5571ed7fed8ab2f088/src/Microsoft.AspNet.Http.Abstractions/HttpContext.cs#L61).\r\n\r\nBesides this being the sensible approach, one legitimate reason is the below scenario: \r\n\r\n - I would like to replace `ITicketStore` with my own implementation and that implementation rely on another service which is scoped per http request inside the services collection."},"comment":{"url":"https://api.github.com/repos/aspnet/Security/issues/comments/160596171","html_url":"https://github.com/aspnet/Security/issues/591#issuecomment-160596171","issue_url":"https://api.github.com/repos/aspnet/Security/issues/591","id":160596171,"user":{"login":"PinpointTownes","id":6998306,"avatar_url":"https://avatars.githubusercontent.com/u/6998306?v=3","gravatar_id":"","url":"https://api.github.com/users/PinpointTownes","html_url":"https://github.com/PinpointTownes","followers_url":"https://api.github.com/users/PinpointTownes/followers","following_url":"https://api.github.com/users/PinpointTownes/following{/other_user}","gists_url":"https://api.github.com/users/PinpointTownes/gists{/gist_id}","starred_url":"https://api.github.com/users/PinpointTownes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PinpointTownes/subscriptions","organizations_url":"https://api.github.com/users/PinpointTownes/orgs","repos_url":"https://api.github.com/users/PinpointTownes/repos","events_url":"https://api.github.com/users/PinpointTownes/events{/privacy}","received_events_url":"https://api.github.com/users/PinpointTownes/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T10:51:50Z","updated_at":"2015-11-30T10:51:50Z","body":":-1: for `ITicketStore` (as resolving it from the DI container would affect every instance of the cookies middleware in a same application) but :+1: for `ISystemClock` :smile: "}}