I play with DotNetOpenAuth samples, trying to figure out how to integrate correctly with OpenID. One of the samples is called OpenIdRelyingPartyMvc. It has two sections of code, which I'm not sure how they affect functionality.
In Global.asax.cs:
routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = string.Empty }); // Parameter defaults routes.MapRoute( "Root", string.Empty, new { controller = "Home", action = "Index", id = string.Empty });
If I delete the last line that displays โRouteโ, nothing seems to be affected: matching โDefaultโ seems sufficient. Why is there a Route Route?
In HomeController.cs
public class HomeController : Controller { public ActionResult Index() { Response.AppendHeader( "X-XRDS-Location", new Uri(Request.Url, Response.ApplyAppPathModifier("~/Home/xrds")).AbsoluteUri); return View("Index"); } public ActionResult Xrds() { return View("Xrds"); } }
If I remove the call to "AppendHeader" and test the sample, it still works! I understand that this header is enough, I just can not make the sample application depend on it: it works without its configuration. If I set a breakpoint inside the Xrds method, it never starts.
source share