{"action":"closed","issue":{"url":"https://api.github.com/repos/IdentityServer/IdentityServer3/issues/1332","labels_url":"https://api.github.com/repos/IdentityServer/IdentityServer3/issues/1332/labels{/name}","comments_url":"https://api.github.com/repos/IdentityServer/IdentityServer3/issues/1332/comments","events_url":"https://api.github.com/repos/IdentityServer/IdentityServer3/issues/1332/events","html_url":"https://github.com/IdentityServer/IdentityServer3/issues/1332","id":74405838,"number":1332,"title":"Unable to cast object of type 'Autofac.Core.Lifetime.LifetimeScope' to type 'Autofac.ILifetimeScope'.","user":{"login":"daveraine","id":4315787,"avatar_url":"https://avatars.githubusercontent.com/u/4315787?v=3","gravatar_id":"","url":"https://api.github.com/users/daveraine","html_url":"https://github.com/daveraine","followers_url":"https://api.github.com/users/daveraine/followers","following_url":"https://api.github.com/users/daveraine/following{/other_user}","gists_url":"https://api.github.com/users/daveraine/gists{/gist_id}","starred_url":"https://api.github.com/users/daveraine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daveraine/subscriptions","organizations_url":"https://api.github.com/users/daveraine/orgs","repos_url":"https://api.github.com/users/daveraine/repos","events_url":"https://api.github.com/users/daveraine/events{/privacy}","received_events_url":"https://api.github.com/users/daveraine/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/IdentityServer/IdentityServer3/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/IdentityServer/IdentityServer3/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":{"login":"brockallen","id":649492,"avatar_url":"https://avatars.githubusercontent.com/u/649492?v=3","gravatar_id":"","url":"https://api.github.com/users/brockallen","html_url":"https://github.com/brockallen","followers_url":"https://api.github.com/users/brockallen/followers","following_url":"https://api.github.com/users/brockallen/following{/other_user}","gists_url":"https://api.github.com/users/brockallen/gists{/gist_id}","starred_url":"https://api.github.com/users/brockallen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brockallen/subscriptions","organizations_url":"https://api.github.com/users/brockallen/orgs","repos_url":"https://api.github.com/users/brockallen/repos","events_url":"https://api.github.com/users/brockallen/events{/privacy}","received_events_url":"https://api.github.com/users/brockallen/received_events","type":"User","site_admin":false},"milestone":null,"comments":16,"created_at":"2015-05-08T15:43:45Z","updated_at":"2015-05-13T14:54:38Z","closed_at":"2015-05-13T14:54:38Z","body":"I've updated my project from IdentityServer3 1.5.5 to 1.6.0 and am now getting the following error during my user login process:\r\n\r\n```\r\nSystem.InvalidCastException: Unable to cast object of type 'Autofac.Core.Lifetime.LifetimeScope' to type 'Autofac.ILifetimeScope'.\r\n   at Microsoft.Owin.OwinContext.Get[T](String key)\r\n   at Autofac.Integration.Owin.OwinContextExtensions.GetAutofacLifetimeScope(IOwinContext context)\r\n   at Autofac.Integration.WebApi.Owin.DependencyScopeHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n   at System.Web.Http.HttpServer.<>n__FabricatedMethod9(HttpRequestMessage , CancellationToken )\r\n   at System.Web.Http.HttpServer.<SendAsync>d__0.MoveNext()\r\n```\r\n\r\nIn the call stack it originates from ThinkTecture.IdentityServer.AccessTokenValidation.dll, so apologies if this is not the correct place to raise this issue.\r\n\r\n```\r\nThinktecture.IdentityServer3.AccessTokenValidation.dll!Thinktecture.IdentityServer.AccessTokenValidation.ScopeRequirementMiddleware.Invoke(System.Collections.Generic.IDictionary<string,object> env) Line 50\tC#\r\n```\r\n\r\nMy best guess is that it is related to [this commit](https://github.com/IdentityServer/IdentityServer3/commit/91d362ae13b0df8e8458a02665d6c6c77eb5ff5d), changing the way Autofac middleware is registered."}}