Is there a practical way to access the attributes decorating a controller or action from a Message Handler/ DelegatingHandler?
From the diagram on Pedro Felix's blog entry, it looks like Message Handler's are too early in the pipeline and the info won't be available until the Controller Dispatcher Message Handler runs. Correct?
About my use case:
I'm working with the Thinktecture identity model, and it would be useful to be able to look for the AllowAnonymous
attribute in the AuthenticationHandler
.
AuthenticationHandler
is implemented as a Message Handler. An invalid token stops processing and returns an HTTP 401. This is perfect for every situation...**except** for when you want an exemption for the method that issues valid tokens (assuming one is self issuing, instead of using a 3rd party service). – Sarracenia