firebase / quickstart-java

Quickstart samples for Firebase Java Admin SDK
Apache License 2.0
234 stars 143 forks source link

PersistentConnection: pc_0 - Auth token revoked: expired_token (Auth token is expired.) #5

Closed edgesoft closed 8 years ago

edgesoft commented 8 years ago

When the server has been up and running for a while I get this. How can I make the token not expire?

samtstern commented 8 years ago

@edgesoft how are you getting the token? Does the SDK recover from this and get itself a new token?

edgesoft commented 8 years ago

@samtstern

final File resource = new File(serviceAccountFile);
FirebaseOptions options = new FirebaseOptions.Builder()
.setServiceAccount(new FileInputStream(resource))
.setDatabaseUrl(database)
.build();
FirebaseApp.initializeApp(options);
DatabaseReference ref = FirebaseDatabase.getInstance().getReference(getCompletedTaskPath());
edgesoft commented 8 years ago

@samtstern It does not recover

mikelehen commented 8 years ago

This is log message is actually expected / benign and the SDK should recover. When you say it does not recover, can you elaborate on what exactly stops working?

edgesoft commented 8 years ago

@mikelehen Yes, you are right. Wrong of me. Thanks!