Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Darran 1 post 71 karma points
    Jul 15, 2017 @ 16:55
    Darran
    0

    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.

  • James Jackson-South 489 posts 1747 karma points c-trib
    Jul 21, 2017 @ 15:19
    James Jackson-South
    0

    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-255362

    Update.

    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

Please Sign in or register to post replies

Write your reply to:

Draft