When does routing take place in the ASP.NET MVC pipeline?
ASP.NET Application Life Cycle Overview for IIS 7.0
Is it in step number 2 (Perform Url Mapping)?
I intend to have a few routes that have an id
"activate/{id}"
"forgotpassword/{id}"
I would like to be able to access the id early on in the pipline in step 4 – AuthenticateRequest. So that I can pass an authentication token through the id part of the url to my custom authentication module.
So can I access the id property in my custom authentication module or do I have to manually extract it from the request url?
Thanks for your help,
Duncan
It appears that the UrlRouting takes place at step number 9 – PostResolveRequestCache.
So it does in fact take place after AuthenticateRequest which is step number 4.
This is the document for UrlRoutingModule
I looked up it’s Init() method in reflector and that is where it subscribes to the PostResolveRequestCache Event.
So I guess now I have to try and write some code that elegantly extracts the token from the url manually..