title: How to add OAuth facebook login in Ionic/Angular?
body: <p>I'm using the <a href="http://ionicframework.com/">Ionic framework</a> to create an app and I now want to add facebook (oauth2) login. I already implemented a facebook login on my website using OAuth; I simply redirect the user to the relevant facebook URL, let them enter their credentials there and I then get the token in my (<a href="http://flask.pocoo.org/">Flask</a>) backend. This works like a charm.</p>
  
  <p>I now wonder how I can implement the same in my Ionic/Cordova/Angular app. As I see it now there are a couple options:</p>
  
  <ul>
  <li>Redirect the user to the mobile version of Facebook within the Ionic/Cordova webview in the app to authenticate my app (just like I do in my normal website), and then return the user to the Ionic app again. I've got the feeling that this is not the right way to do it though.</li>
  <li>Use Facebooks Javascript authentication which returns the token to the app. I can then POST the token to my server to save it for later usage.</li>
  <li>Let the user insert his username and password in the Ionic app and POST those to my server and then use those to authenticate the user on facebook and get a token for it. This obviously totally defies the purpose of OAuth, but I guess it would work.</li>
  <li>I read <a href="http://ionicframework.com/blog/authentication-in-ionic/">this article on the Ionic blog</a> about how to implement Facebook login, but that uses the <a href="https://auth0.com">Auth0 plugin</a>, which I don't want to use (it costs money and I don't want to be dependent on another company).</li>
  <li>Yet another option which I am not aware of..</li>
  </ul>
  
  <p>So I now wonder; what is the best way to implement (OAuth based) Facebook login in my Ionic app and why? All tips are welcome!</p>