Skip to content
This repository

Controllers are not authenticated when using AOP on them #42

Open
dbelcham opened this Issue October 09, 2012 · 0 comments

1 participant

Donald Belcham
Donald Belcham

If I create and register controllers using:

configuration.ForAllControllers()

And then ignore the policy on some:

configuration.For<LoginController>().Ignore()

And then wrap the LoginController with an aspect using an IoC container that uses DynamicProxy2, FluentSecurity will throw an error saying "Security not configured for Castle.Proxy.LoginControllerProxy"

This happens because the proxy used to do the AOP interception is not of the same type as was marked for .Ignore() in my bootstrapping. Since the proxy class is created in memory at runtime there is no way to configure it using configuration.For() where "xxx" is the in memory proxy class.

The only option I can think of to fix this is something like this:

configuration.For<LoginController>("{0}Proxy").Ignore()

where the string value "{0}Proxy" does a string.Format inserting the name of the type inserted as T in the For.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.