title: C# Facebook SDK - How to use web forms to server side authorize canvas application
body: <p>There are lots of sample applications in MVC but the current project I'm working on requires that I use web forms.   </p>
  
  <p>I can authorize the application using the javascript method but I want to use server side.   Below is what I started with on the page.load</p>
  
  <pre><code>dynamic parameters = new ExpandoObject();
  parameters.client_id = AppId;
  parameters.client_secret = appSecret;
  parameters.response_type = "code";
  //parameters.state = state;
  parameters.redirect_uri = "http://fb.local/page.aspx";
  
  // The requested response: an access token (token), an authorization code (code), or both (code token).
  parameters.response_type = "token";
  
  // list of additional display modes can be found at http://developers.facebook.com/docs/reference/dialogs/#display
  //parameters.display = "popup";
  
  // add the 'scope' parameter only if we have extendedPermissions.
  if (!string.IsNullOrWhiteSpace(ExtendedPermissions))
  parameters.scope = ExtendedPermissions;
  
  // generate the login url
  var fb = new FacebookClient();
  var loginUrl = fb.GetLoginUrl(parameters);
  
  Response.Redirect(loginUrl.AbsoluteUri, true);
  </code></pre>
  
  <p>I can authorize but I'm  not able to get the access token from the URL.</p>
  
  <p>On the next page I can view source and see the access token in the url bar but I'm not sure how to go about getting it into the code.  once I have the token, I'm all set.</p>
  
  <pre><code>page.aspx#access_token=AAACrxQhmdpY
  </code></pre>