2

I have a scenario whereby I want to route http requests from authenticated users to specific websites hidden behind a reverse proxy. The decision of which site to route too is based on the specific user. For example, user 'Mary' may be routed to site "b"; user 'John' may be routed to site "e".

I am hosting the sites on IIS and am using ARR as my reverse proxy. I'm trying to figure out the best way to use URL Rewrite to make the routing decision.

One idea I had was to build a custom URL Rewrite provider that decrypts the FormsAuthTicket (created by an ASP.NET MVC website) and makes the routing decision based on information in that cookie.

Can anyone provide some guidance on how I can solve this problem? Am I on the right path?

Brad Leach
  • 16,857
  • 17
  • 72
  • 88
  • Why decrypt the cookie? You'll already will have the current user name in System.Web.HttpContext.Current.User.Identity.Name and the rest of data can be easily retrieved using the Membership API. – Oscar Dec 19 '13 at 11:44
  • The routing decision is made before I hit ASP.NET code - so as far as I am aware, I can't use System.Web.HttpContext.Current.User from the custom URL Rewrite provider. I may be missing something here, though, that could be making this much simpler. :-) – Brad Leach Dec 19 '13 at 11:49
  • You're right: http://blogs.msdn.com/b/varunm/archive/2013/10/03/understanding-of-mvc-page-life-cycle.aspx I guess then taht you're approach is the best way to get user's data – Oscar Dec 19 '13 at 11:56

0 Answers0