How do redirections work in ASP.Net MVC?
I've copied and modified the code bit from Scott Henselman's blog that uses DotNetOpenId to login via OpenID. Debugging, I find that when executing this code segment:
// Stage 2: user submitting Identifier
var openId = Request.Form["openId"];
new OpenIdRelyingParty().CreateRequest(openId).RedirectToProvider();
throw new Exception("Should never get here");
I never get to the throw clause, but rather continue with the redirection. How does that work?
Then, when I get the response from the OpenId provider, I'm debugging through this code segment:
switch (response.Status)
{
case AuthenticationStatus.Authenticated:
FormsAuthentication.RedirectFromLoginPage(response.ClaimedIdentifier, false);
// am I supposed to reach this line? What should I return here?
// (The method expects a View to be returned)
And I find that the call to FormsAuthentication.RedirectFromLoginPage() does return and I need to return something from the Action. What should I return here?