title: Xamarin Forms + IdentityServer + External Providers (Facebook/Google)
body: <p>I have an ASP.NET Core Web App and ASP.NET Core Web API and am currently using IdentityServer4.</p>
  
  <p>I am adding a Xamarin Forms application (Android + iOS) and I can't find any examples of a Xamarin Forms application that uses Facebook and/or Google along with IdentityServer. </p>
  
  <p>A lot of the samples I've come across use WebViews, which I don't want to use and want to use either Native App (Facebook/Google) or Mobile Browser (Chrome/Safari) to authenticate (depending if the Facebook/Google app is installed on the users device).</p>
  
  <p>I'm also confused as to what the user flow would be on a mobile, i.e.:</p>
  
  <ul>
  <li>User opens app</li>
  <li>User clicks Facebook login</li>
  <li>App redirects user, via IdentityServer, to Facebook mobile site
  (safari/chrome) </li>
  <li>User logs into Facebook / Allows access to my app</li>
  <li>User is then redirected back to Identity server </li>
  <li>Identity server logs in / registers user </li>
  <li>Identity server then re-opens my mobile app passing token</li>
  <li>My app then saves token and uses this for all api calls going forward</li>
  </ul>
  
  <p>I've been using the information and basing my system on the <a href="https://github.com/dotnet-architecture/eShopOnContainers/tree/master/src/Mobile" rel="noreferrer">eShopOnContainers enterprise reference app</a> and using this micro-service type architecture and the only thing that's missing (for my purposes) is a social login, otherwise this architecture is precisely the type of thing we're building.</p>