title: Facebook authentication and Asp.Net Membership
body: <p>I'm trying to integrate facebook authentication with an asp.net site.</p>
  
  <p>So if a user decides to register at the site they can do so by using their facebook credentials.</p>
  
  <p>I'm currently at the point where I have the facebook access token and the user details and not sure how I should go from here.</p>
  
  <p>The site uses asp.net membership authorization.  </p>
  
  <p>This is what I believe should happen in case a new user decides to register: (But not sure if this the the way to go)</p>
  
  <p>0) User visits the site and decides to register using their facebook credentials.<br>
  1) The user providers their credentials and I receive an access token and their user information.<br>
  2) I store this information in my database and create an asp.net membership user with the data I received. <strong>(At this point I'd have to generate a password).</strong><br>
  3) Log the user into the site so he can navigate freely.</p>
  
  <p>I would appreciate some advice if I'm on the correct path and how I should go about generating the password. (I'm thinking in maybe combining the email and facebook userId, retrieve a hash and store.)</p>
  
  <p>Thanks</p>
  
  <p><strong>UPDATE 1</strong><br>
  I found <a href="https://stackoverflow.com/questions/1871010/asp-net-memebership-authorization-without-password">this</a> SO question where they suggest to use:</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.setauthcookie(v=VS.90).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.setauthcookie(v=VS.90).aspx</a></p>