title: Custom Firebase user identity not using the Firebase user uid
body: <p>I´m playing around with the <a href="https://github.com/firebase/FirebaseUI-Android" rel="nofollow noreferrer">FirebaseUI-Android</a> and have a question about what ID to use when uniquely identify users. The FirebaseUI managed the authentication right and return the <code>IdpResponse</code> object. This can be e.g. Facebook, Twitter, Phone and more.. This is grate thanks everyone behind this.</p>
  
  <p>Because the <code>FirebaseUser.getUid()</code> can change when user delete/recreate his account therefore i don't want to link my users data with the <code>FirebaseUser.getUid()</code> token. </p>
  
  <p>In the future if I decide to let user wipe there account the uid will change when user come back and all user history for that user in my system is not accessible anymore right. Also in the future if I migrate my system to someplace the uid will not be that handy to have around right?</p>
  
  <p>Now I created this wrapper(code below) to create a unique ID extrapolated from the data inside the <code>IdpResponse</code>. Dunno really but I figure doing it this way there will never be a "id" collision unless there´s a Google2.0 e.g. Twitter2.0 :) right. And at the same time it´s easier to debunk bugs in the system because id´s are not UUID.</p>
  
  <p>Is this a recommended way to handle the user id problem. I really need some feedback and pitfalls warnings about this.        </p>
  
  <pre><code>@Override
  public String getUserId() {
      String userId;
      FirebaseUser user = getInstance().getCurrentUser();
      if (user.getEmail() != null)
          // User sign in with E-Mail
          userId = user.getEmail().replace(".", ",");
      else if (user.getPhoneNumber() != null){
          // User sign in with Phone
          userId = user.getPhoneNumber();
      }else
          // User sign in with Twitter or Facebook 
          userId = user.getUid();
      return userId;
  }
  </code></pre>
  
  <p>What bother me most with this is the Twitter or Facebook since I still have to use the <code>FirebaseUser.getUid()</code>.  Is the <code>IdpResponse.getIdpToken()</code> better to us?</p>