title: Migrate an existing project to Firebase : Authentication handling & Preserve existing JWT
body: <p>I've an existing project that is built on : </p>
  
  <ul>
  <li>AngularJS</li>
  <li>Google App Engine backend, PHP, with an authentication based on JWT</li>
  </ul>
  
  <p>I'm in process of rewriting the frontend to move to Angular 8 and I want to leverage the firebase features.</p>
  
  <p>I'm currently working on integrating the authentication feature (username/password, google, twitter, facebook etc...)</p>
  
  <p>And I'm thinking about my next step : </p>
  
  <ul>
  <li>Once my use is authenticated with firebase, how can my GAE PHP backend check that the user is authenticated ?</li>
  <li>In my JWT, I've set some basic user information, that are essential to my backend function.
  
  <ul>
  <li>uid, first name, last name, entityId, entityName, roleId, environmentId</li>
  </ul></li>
  </ul>
  
  <p>I was imagining something like : </p>
  
  <ul>
  <li>once authenticated with firebase, call my GAE Backend with the OAuth2 token</li>
  <li>call some magic function that will validate the OAuth2 token and associate the firebase user, with my internal user table</li>
  <li>reply with a JWT</li>
  <li>Include the JWT and the OAuth2 token in every call</li>
  </ul>
  
  <p>Would this work ? any suggestions ? </p>