Giter VIP home page Giter VIP logo

Comments (4)

briangullo avatar briangullo commented on August 28, 2024 1

Ok... well.. I feel like an idiot. I was working in some new code, not realizing the StartUp.cs was not being used to set up the OWIN environment. Very similar code was being wired up elsewhere in the application, so the OWIN behavior looked very similar. Once I wired up the Startup.cs I built, AutoFac started to work as designed. Sorry for the false alarm.

B

from autofac.webapi.

tillig avatar tillig commented on August 28, 2024

While I don't see anything obvious, I'm on my mobile at the moment and am not doing heavy research. Since I mostly dev on Mac nowadays, it will take a while to be able to set something up to troubleshoot.

This is sort of why the "new issue" page directs "how do I?" questions to Stack Overflow - there are folks doing this stuff all the time that can quickly answer the questions, and the Autofac team monitors there. For issues, only the Autofac team (of, like, three total people) watch, and it means answers may be slow.

I might recommend:

  • See if you can get any type of Autofac filter to work - not just authorization. If you can't get any filter to work, you might be setting something up wrong. For example, sometimes folks think they're using OWIN but are still referencing the global dependency resolver. (Not saying you're doing that, just giving an example.)
  • Look at examples in our Examples repo. Any examples there showing filter usage?
  • Look at the unit tests in this repo. Anything show what you're doing?
  • Are you actually using it as an attribute? Web API makes attributes singletons. I think we touch on that in the docs. What happens if you implement the Autofac interface but don't derive from the attribute?

Anyway, these are the steps I'd have to go through to figure it out. Sadly, I just can't keep every detail of every integration in my head anymore so I don't have these answers at my fingertips. Again, that's why we rely on Stack Overflow - to get more eyes from the community on questions, so we can focus on reproducible issues in the repos.

If you figure it out, post back here so we can close the issue. If you don't... It may take a bit before I can personally come in and figure this out.

from autofac.webapi.

alistairjevans avatar alistairjevans commented on August 28, 2024

I've taken a quick peek at the code; nothing obvious jumps out at me either. I'd consider:

  • Enabling Autofac Diagnostics, and seeing if Autofac ever resolves an IEnumerable<Meta<Lazy<IAutofacAuthorizationFilter>>>. If it does, then you know that we're actually looking for those filters, and you can hopefully see subsequently in the diagnostics that one item gets loaded from that set.

  • If that doesn't yield anything, consider putting together a minimal recreating project of an Authorization filter not working, outside of any of your other project behaviour. As @tillig said, this sort of stuff, particularly in the OWIN world, can be easily caused by something wrong somewhere else.

from autofac.webapi.

briangullo avatar briangullo commented on August 28, 2024

Thanks @tillig and @alistairjevans . Let me work on your suggestions, and I will report back my findings The first thing I'm going to try is setting up a simple action filter and see if I can get that to work. I'll keep this thread posted. Thanks!

from autofac.webapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.