Regarding: Order of Operations.
If I have a custom AuthProvider that implements IAuthWithRequest, does the IAuthWithRequest.PreAuthenticate method get called before any GlobalRequestFilters get executed?
I have some code that is currently in a GlobalRequestFilter that needs to run before any IAuthWithRequest.PreAuthenticate methods.
This code simply needs to inject the IRequest into a property of a dependency in the container (which implements IRequiresRequest) and then call some useful methods. (as you can see below)
GlobalRequestFilters.Add((request, response, dto) =>
{
var myThing = request.TryResolve<IMyThing>();
var hasRequest = myThing as IRequiresRequest;
if (hasRequest != null)
{
hasRequest.Request = request;
}
var thing = myThing.DoSomethingUseful();
...
});
So, am trying to figure out whether I need to to move that code further up the request pipeline or not, and to where.