title: Laravel Passport and Ionic2 Facebook-Login
body: <p>I am developing a mobile app which should do API calls to an own laravel backend.</p>
  
  <p><strong>Frontend:</strong> Ionic 2 + Angular2</p>
  
  <p><strong>Backend:</strong> Laravel 5.3 + Laraval Passport + MySQL </p>
  
  <p>At the user can log in with <em>password grant</em> (username + password).</p>
  
  <p><strong>Now I want to offer a login via Facebook.</strong></p>
  
  <p>I've implemented a Login with Facebook-button in the app. This works fine. I get the profile information from the Facebook API: id, email, name</p>
  
  <p>Now this user (has no email + password combination from our server) should be able to make API calls to our Laravel server and should be linked to user in the users-table of the MySQL-database behind the laravel backend. Users which login with Facebook shouldn't need any username or password to login. Just Facebook.</p>
  
  <p>I want to generate a new user in the database for each facebook user (simply with a column facebook_id). <strong>But how to give such users an access_token?</strong></p>
  
  <p>Accepting just the Facebook ID, match this (or create new) user in the database and create an access_token would be very unsecure because Facebook ID is public...</p>