title: ASP.NET Web API social authentication for Web and Mobile
body: <p>My question is kind of complex so bear with me as I try to lay it out nicely what I am struggling with.</p>
  
  <p><strong>Goal</strong></p>
  
  <p>Have an ASP.NET website that lets users register &amp; sign-in via Username/Password or Social (Facebook, Twitter, Google, etc) that also has an API. This API needs to be locked down with <code>[Authorize]</code>. The API needs to be able to be accessed by mobile clients (Android, iOS, etc) that can be signed in via Username/Password or Social (Facebook, Twitter, Google, etc).</p>
  
  <p><strong>Background</strong></p>
  
  <p>So I have done sites that can do one or two things from my goal but not all together. There are great examples online and built in examples into VS projects that show how to let the user register and sign-in via social apps but they are only for the website and not for mobile. I have done a website that an Android app uses Username/Password to authenticate with that API, but nothing with OAuth or Social credentials.</p>
  
  <p>I started out using this <a href="http://bitoftech.net/2014/08/11/asp-net-web-api-2-external-logins-social-logins-facebook-google-angularjs-app/" rel="noreferrer" title="page">page</a> as a reference but I have no clue how to take that and make it work for my website logging in and for my mobile app logging in.</p>
  
  <p><a href="https://stackoverflow.com/questions/21065648/asp-net-web-api-2-how-to-login-with-external-authentication-services/21358918#21358918">This guy</a> makes it sound so easy but doesn't show any code for this.</p>
  
  <p><strong>Question</strong></p>
  
  <p>Is there a tutorial or GitHub example somewhere that can get me to my goal? I basically want a website where people can register a username/password or use their social account AND also let the user do the same (register &amp; login) via a mobile device. The mobile device will basically just use the API to push/pull data, but I am unsure how to incorporate social logins with my API. I assume I need to use OAuth and go that route but I cannot find any good examples that show how to do this for both web and mobile.</p>
  
  <p>Or maybe is the right solution is to have the webpage be all cookie auth and the API be a separate "web site" and be all token auth and they both tie to the same database?</p>