title: Firebase in Cordova/Phonegap: Log in using Email/Password from within app?
body: <p>I'm running a webview from a cordova app and want to authenticate a user, I know they have the OAuth strategies but I need to use the email/password combination.</p>
  
  <p>I'd like to keep things simple but may end up having to generate a token.</p>
  
  <ul>
  <li>Open an InAppBrowser that loads an auth flow for firebase</li>
  <li>Listen for that auth flow to be completed using this method: <a href="http://blogs.telerik.com/appbuilder/posts/13-12-23/cross-window-communication-with-cordova%27s-inappbrowser" rel="nofollow">http://blogs.telerik.com/appbuilder/posts/13-12-23/cross-window-communication-with-cordova%27s-inappbrowser</a></li>
  <li>Grab the result from the webview again and insert it into the webview firebase instance</li>
  </ul>
  
  <p>I'm guessing that's not possible due to security.</p>
  
  <p>My app is using Amazon login (required) so my alternative would be:</p>
  
  <ul>
  <li>webview loads InAppBrowser with our external url</li>
  <li>that loads Amazon auth, then generates a token for Firebase</li>
  <li>webview listens for token and grabs it, stores it in localstorage</li>
  </ul>
  
  <p>Edit:
  In the firebase docs on logging in with a username/password, I see it returns a token for the session and more information in the <code>authData</code> object:
  <a href="https://www.firebase.com/docs/web/guide/user-auth.html" rel="nofollow">https://www.firebase.com/docs/web/guide/user-auth.html</a></p>
  
  <p>Could I then take all the information from that object and send it back over to the cordova webview and then populate that Firebase ref with the information?</p>