UmbracoUserTimeoutFilter executed twice after integrating Ninject with WebApi
Using Umbraco 7.6.3 with Ninject 3.2.2 configured for MVC DI (Ninject.MVC5 3.2.1), all was fine. Adding the GlobalConfiguration.Configuration.DependencyResolver to enable DI for WebApi (Ninject.Web.WebApi 3.2.4) controllers has caused the UmbracoUserTimeoutFilter to be executed twice and thus the response has the X-Umb-User-Seconds header added twice.
This means that the interceptor in the back office gets two comma separated values which causes a NaN when executing and I get logged out of the back office within 5 seconds when the check runs.
From what I can tell, this action filter is only registered by attributing the UmbracoAuthorizedApiController layer supertype, so I'm not even sure how the introduction of DI into WebApi could cause the issue.
If anyone has any suggestions as to why this might be happening, it would be greatly appreciated.
I managed to get this working. The trick is to only resolve non-umbraco controllers. There's too much code to post here but I can link to a github snapshot which you should be able to grab what you need from.
UmbracoUserTimeoutFilter executed twice after integrating Ninject with WebApi
Using Umbraco 7.6.3 with Ninject 3.2.2 configured for MVC DI (Ninject.MVC5 3.2.1), all was fine. Adding the
GlobalConfiguration.Configuration.DependencyResolver
to enable DI for WebApi (Ninject.Web.WebApi 3.2.4) controllers has caused theUmbracoUserTimeoutFilter
to be executed twice and thus the response has theX-Umb-User-Seconds
header added twice.This means that the interceptor in the back office gets two comma separated values which causes a NaN when executing and I get logged out of the back office within 5 seconds when the check runs.
From what I can tell, this action filter is only registered by attributing the
UmbracoAuthorizedApiController
layer supertype, so I'm not even sure how the introduction of DI into WebApi could cause the issue.If anyone has any suggestions as to why this might be happening, it would be greatly appreciated.
I'm stuck in the same situation as you. I've already tried the solution offered here to no avail.https://our.umbraco.org/forum/extending-umbraco-and-using-the-api/79874-problem-with-using-ninject-as-ioc-container#comment-255362Update.
I managed to get this working. The trick is to only resolve non-umbraco controllers. There's too much code to post here but I can link to a github snapshot which you should be able to grab what you need from.
https://github.com/JimBobSquarePants/Zoombraco/tree/de72f9327d19ac5cb2d392318fb451b685d6664a/tests/ZoombracoDemo.Logic/App_Start
is working on a reply...