Fixed windows auth.
- Made the windows auth middleware run at the right point
 in the IIS pipeline.

#944