title: Get oAuth 2.0 access token from asp.net webforms iframe canvas application
body: <p>The question says it all:</p>
  
  <p><strong>How can I get an access token to use on graph api calls from a asp.net webforms 4.0 iframe canvas app.</strong></p>
  
  <p>My canvas application has been configured to enable the OAuth 2.0 for Canvas (beta) among other things.</p>
  
  <p><img src="https://i.stack.imgur.com/7LPQj.png" alt="alt text"></p>
  
  <p>This means I am getting the <code>signed_request</code> parameter on my iframe which I am successfully reading.</p>
  
  <p>From the <a href="http://developers.facebook.com/docs/authentication/canvas" rel="nofollow noreferrer">oficial documentation on canvas authentication</a></p>
  
  <blockquote>
    <p>The signed_request parameter is the concatenation of a HMAC SHA-256 signature string, a period (.), and a base64url encoded JSON object.</p>
  </blockquote>
  
  <p>There is a php code in the documentation which decodes the <code>signed_request</code> but I haven't been able to implement it propertly in C# partly beacuse to be honest I prefer not to reinvet the wheel but to use someone else code that has been already tested.</p>
  
  <p>This is where my quest for a good C# Facebook SDK started again (since facebook changes everything every few months librarys get usually obsolete).</p>
  
  <p>I have used the codeplex's <a href="http://facebooktoolkit.codeplex.com/" rel="nofollow noreferrer">Facebook Developer Toolkit</a> in the past but it seems to be getting outdated ans the lastest stable release is very old (in facebook API time)</p>
  
  <p>Some months ago used the <a href="http://github.com/facebook/csharp-sdk" rel="nofollow noreferrer">Oficial Facebook C# SDK</a> from GitHub but it lacks completly the authentication support.</p>
  
  <p>Now I have found on Nuget and really liked the Facebook C# SDK from <a href="https://stackoverflow.com/users/75505/nathan-totten">Nathan Totten</a> who is one of the <a href="https://stackoverflow.com/tags/facebook/topusers">top Facebook Experts</a> here in StackOverflow.</p>
  
  <p>If you Nathan read this (or anyone that also uses this sdk), how can I use this SDK to get an access token to use in my canvas app.</p>
  
  <p>Anyway if there is a better way to get a token, maybe with the Javascript library please let me ( and the people who wonder the same as me ) know.</p>