asp.net mvc - Get through SiteMinder folder rule with MVC routing -


there siteminder rule placed in allow access "/public/*" pages unauthenticated users. in mvc folder structure there no physical folder (or area) called "public" , don’t want should able add public pages freely in area. now, unauthenticated users not have access public pages (actions). need workaround through siteminder public pages.

there 2 things in mind need find solution.

  1. rewrite routes prepending "/public" them (conditionally may based on authorized attribute) siteminder.

  2. once url received "/public" should routed proper area/controller/action ignoring "/public" portion of it.

i still couldn’t figure out way code above. if experts know how achieve above or have different thoughts please post.

cheers, moosila

finally question narrowed down "how can rewrite route adding "/public" after root , before area/controller/action?"

i did poc achieve above of co-worker: using reflection obtain appropriate controller name, action name , analysing namespace area name. have new pattern "/public".

routeurlpattern = string.format("public/{0}/{1}/{2}/{{id}}", areaname, controllername, actionname); routetable.routes.add(new route(routeurlpattern, new mvcroutehandler()) 

above routes should added before non public routes in the table work /public.


Comments