title: Android Firebase : Second Connected Database not allowing auth in rules
body: <p>I've connected two Databases from the same firebase project like below.</p>
  
  <pre><code>    //init the default db;
      FirebaseApp.initializeApp(this);
  
      //init the second db;
      FirebaseOptions.Builder builder = new FirebaseOptions.Builder();
      builder.setApplicationId("id"); //Same as default
      builder.setApiKey("key"); //Same as default 
      builder.setDatabaseUrl("https://second-db.firebaseio.com");
  
      try {
          FirebaseApp.initializeApp(this, builder.build(), "second-db");
      } catch (IllegalStateException e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>Getting Reference. </p>
  
  <pre><code>public static DatabaseReference getSecondDbRef(String child) {
      FirebaseApp app = FirebaseApp.getInstance("second-db");
      return FirebaseDatabase.getInstance(app).getReference(child);
  }
  </code></pre>
  
  <p>With the above, it works, but the rules in the second database don't seem to be getting auth. if I do.</p>
  
  <pre><code> {
     "rules":{
            "users":{
                   "$uid":{
                         ".read":"auth.uid !== null",
                         // ".read":true // This works, so the issue is auth
                    }
            }
     }
  }
  </code></pre>
  
  <p>The read fails, even though the user is authenticated, also, this problem isn't there with the default database. Is there anything I'm missing with the init?</p>
  
  <p>Ok, because of highlights below, here's the code as it is on the app.</p>
  
  <pre><code>    private static final String  TEAMS_BD_ID   = "second-db"
  
      public void initFirebase() {
          FirebaseApp.initializeApp(this);
  
          FirebaseOptions.Builder builder = new FirebaseOptions.Builder();
          builder.setApplicationId("appId"); // //Same as default
          builder.setApiKey("key"); // //Same as default
          builder.setDatabaseUrl("https://teams-db.firebaseio.com");//Second Db
  
          try {
              FirebaseApp.initializeApp(this, builder.build(), TEAMS_BD_ID);
          } catch (IllegalStateException e) {
              e.printStackTrace();
          }
      }
  
      public static FirebaseApp getTeamsApp() {
          return FirebaseApp.getInstance(TEAMS_BD_ID);
      }
  
      public static String getTeamsUserUid() {
          return FirebaseAuth.getInstance(getTeamsApp()).getCurrentUser().getUid();
      }
  
      public static DatabaseReference getTeamsRef(String child) {
          return FirebaseDatabase.getInstance(getTeamsApp()).getReference(child);
      }
  
      public static DatabaseReference getTeamsRef() {
          return FirebaseDatabase.getInstance(getTeamsApp()).getReference();
      }
  </code></pre>
  
  <p>Then trying to read.</p>
  
  <pre><code>DatabaseReference r = getTeamsRef().child("users/" + getTeamsUserUid() + "/teams") 
  // getTeamsUserUid()  This is null.
  </code></pre>