title: Facebook login causes endless redirect loop
body: <p>I am working on asp.net mvc. I am trying to implement Facebook Integration for my MVC application. Here my i have chosen OAuth mechanism for facebook login. Here is my markup,</p>
  
  <pre><code>&lt;a href="/Account/FacebookLogin"&gt;Login With Facebook&lt;/a&gt;
  </code></pre>
  
  <p>and here is my action,</p>
  
  <pre><code> public ActionResult FacebookLogin()
   {
              oAuthFacebook oauth = new oAuthFacebook();
              return new RedirectResult(oauth.AuthorizationLinkGet());
   }
  </code></pre>
  
  <p>And my callback url is <code>/Home/FBLogin</code></p>
  
  <pre><code>public ActionResult FBLogin()
  {
      oAuthFacebook oAuth = new oAuthFacebook();    
        if (Request["code"] == null)
        {
            //Redirect the user back to Facebook for authorization.
            return new RedirectResult(oAuth.AuthorizationLinkGet());
        }
        else
        {
              oAuth.AccessTokenGet(Request["code"]);    
              if (oAuth.Token.Length &gt; 0)
              {
                 //Handle Accesstoken : oAuth.Token
              }
        }
        return RedirectToAction("Dashboard", "Home");                
   }
  </code></pre>
  
  <p>Here my problem is when i already login in Facebook site and then open my site and click on login with facebook button it works very fine.</p>
  
  <p>But if I didn't login in facebook site and i want to freshly login into facebook via my mvc app. it causes facebook redirect loop that means it keep on calling my callback url so that i can't redirect to Dashboard action in my case and it stops me in the Facebook login page with reloading. I have cleared all cookies and try but it doesn't change. I am unable to find whether the mistake is i my side or facebook side. </p>
  
  <p><strong>UPDATE:</strong>
  If I add an attribute <code>auth_type=reauthenticate</code> to solves my problem and is works fine. If i already logged in in facebook site it reauthenticate me. If i logged out in facebook site and try to login via my application it asks me the password about <strong>2 times</strong> One for normal login and another for re-authenticate login. Is there any way that i overcome this behavior? please guide me. Thanks you.</p>