Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorize attribute calls two times #385

Open
artkh24 opened this issue Nov 16, 2021 · 1 comment
Open

Authorize attribute calls two times #385

artkh24 opened this issue Nov 16, 2021 · 1 comment

Comments

@artkh24
Copy link

artkh24 commented Nov 16, 2021

I'm using ninject version 3.3.4

        var kernel = new StandardKernel();
        try
        {
            kernel.Bind<Func<IKernel>>().ToMethod(ctx => () => new Bootstrapper().Kernel);
            kernel.Bind<IHttpModule>().To<HttpApplicationInitializationHttpModule>();

            RegisterServices(kernel);
            
            System.Web.Http.GlobalConfiguration.Configuration.DependencyResolver = new NinjectDependencyResolver(kernel);


            return kernel;
        }
        catch
        {
            kernel.Dispose();
            throw;
        }

ninject creates binding for IFilterProvider which makes Authorize attribute two call two times per web api request
are there any options in StandardKernel to avoid this binding

@scott-xu
Copy link
Member

scott-xu commented Mar 5, 2023

Can you please create a minimal web api application that replicate the issue and send it to me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants