I could reproduce this error 100% in iOS with the following steps.
1) Set up the iOS to use a Firebase app (ex. DB1) via the GoogleService-Info.plist
2) Sign in (authenticate using the Firebase email/password authentication).
3) Change the GoogleService-Info.plist to use a different Firebase app (ex DB2).
4) When the app restarts it automatically tries to authenticate to DB2 but it has an invalid token from authenticating with DB1.
5) Firebase internals outputs the error in the console Error: [FirebaseDatabase] Authentication failed: invalid_token (Invalid claim 'aud' in auth token.). It appears to continually output this message every few seconds.
6) Firebase will call the addAuthStateDidChangeListener block, but incorrectly return a user instead of signing the user out. So you are stuck in a limbo state. You appear authenticated but you really are not.
7) The reason I believe this happens is Firebase stores the token in the key chain with the firebase app name (ie "__FIRAPP_DEFAULT" for the default configuration). so if you manually [FIRApp configureWithName ....] the token/app settings are stored in a different keychain. To verify this I could execute code to delete the app keychain, then the app would start in the un-authenticated state.
8) For us we have a dev and a production Firebase. With Firebase 2.x we could simply switch the url path without issue.
9) With the new Firebase it is a bit more problematic. If you manually configure the FIRApp with options it appears the analytics still wants to load GoogleService-Info.plist because you will get some output complaining Firebase could not initialize the analytics because of the missing plist.
10) The ideal solution would have been if you could specify the plist manually (so you can have multiple configs) and specify the app name in it so it would be stored in the a different key chain. (hint: to firebase dev team ;-) )