title: Facebook authentication response parameters are wrong -> infinite request loop
body: <p>I an new to the facebook API and after some work I encountered a problem.
  First, I am using <a href="http://facebooksdk.codeplex.com/documentation" rel="nofollow noreferrer">the facebook SDK</a> for communication with the facebook APIs.</p>
  
  <p>In my app settings I chose that the response of the OAuth dialog should be query string instead of URI fragment.</p>
  
  <p><img src="https://i.stack.imgur.com/rXXaH.png" alt="enter image description here"></p>
  
  <p>On my server I got the following code:</p>
  
  <pre><code>void Page_Load()
  {
      string url = Request.Url.AbsoluteUri;
      Facebook.FacebookOAuthResult result = null;        
      if (!Facebook.FacebookOAuthResult.TryParse(url, out result))
      {
          string redirectUrl = PivotServer.Helpers.GetFacebookOAuthUrl();
          Response.Redirect(redirectUrl);
      }
  }
  </code></pre>
  
  <p>And thats my helper method:</p>
  
  <pre><code>    public static string GetFacebookOAuthUrl()
      {
          FacebookOAuthClient oauth = new FacebookOAuthClient
          {
              AppId = "149637255147166",
              AppSecret = "xxx",
              RedirectUri = new Uri("http://mydomain.com/")
          };
  
          var param = new Dictionary&lt;string, object&gt;
          {
              { "response_type", "token" },
              { "display", "popup" }
          };
  
          Uri url = oauth.GetLoginUrl(param);
  
          return url.AbsoluteUri;
      }
  </code></pre>
  
  <p>I ran my page on a web server (IIS). When I open the page the first time I am asked to log in to facebook, which is alright, but then I ran into an infinity loop, because the Auth Token Parameter (from facebook) is an URI fragment instead if a query string (which I wanted (see picture above)).
  The response URI looks like </p>
  
  <p><code>http://mydomain.com/#access_token=AAACIGCNwLp4BAMccSoliF5EMGJm0NPldv5GpmBPIm9z7rRuSkiia7BM0uhEn1V88c8uOlWOfGc3C8sFC9tq90Ma0OwIm0tWLNU5BBAZDZD&amp;expires_in=0&amp;base_domain=mydomain.com</code> </p>
  
  <p>instead of </p>
  
  <p><code>http://mydomain.com/?code=AAACIGCNwLp4BAMccSoliF5EMGJm0NPldv5GpmBPIm9z7rRuSkiia7BM0uhEn1V88c8uOlWOfGc3C8sFC9tq90Ma0OwIm0tWLNU5BBAZDZD&amp;expires_in=0&amp;base_domain=mydomain.com</code></p>
  
  <p>Is that a bug from the OAuth API, or what am I doing very wrong here?</p>