I'm using Firebase UI Auth to handle email signin in my app and I enabled Disk Persistence so that the data can be accessed offline. But after signed in for an hour in the app, I get this warning in the logcat.
W/PersistentConnection: pc_0 - Auth token revoked: expired_token (Auth token is expired.)
W/PersistentConnection: pc_0 - Authentication failed: invalid_token (Invalid claim 'kid' in auth header.)
W/PersistentConnection: pc_0 - Authentication failed: invalid_token (Invalid claim 'kid' in auth header.)
... repeatedly
... and sometimes
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
When I received this message, the app can't do any firebase save/retrieve new uncached data operation unless I sign out/clear data and then sign in again. Then the problem happened again after about an hour after signed in. I have followed this token refresh troubleshooting guide (added my debug and production key SHA1 to both Firebase and Google API Console) and it does not fix this. I have used the latest google-services.json from the Firebase Console in my project.
I'm also already using latest Firebase SDK and Play Services library
compile 'com.google.android.gms:play-services-auth:9.2.1'
compile 'com.google.firebase:firebase-core:9.2.1'
compile 'com.google.firebase:firebase-database:9.2.1'
compile 'com.google.firebase:firebase-auth:9.2.1'
compile 'com.firebaseui:firebase-ui-auth:0.4.3'
I enabled the persistence in the Application class.
public class Application extends android.app.Application {
@Override
public void onCreate() {
super.onCreate();
FirebaseDatabase.getInstance().setPersistenceEnabled(true);
}
}
Any ideas? Feel free to comment if you need more clarification or if I do not provide enough information. Thank you
22fb7e6f95c657f4407e04e97c984bb6dbbcfeb3- WilikgetToken()in both apps, I found out that their token is the same even though both of them are signed in using different accounts. I have triedFirebaseUser.getEmail()and the output for both apps is different. - Wilik