Search code examples
unity-game-enginefirebasefirebase-realtime-databaseservice-accounts

Firebase for Unity using service accounts hangs fetching auth token


I installed the shiny new Firebase for Unity package and am trying to get the database package to work using a service account, as detailed here. I was able to connect to and work with the database (without a service account) when the rules are left public, but not when using a service account.

Enabling verbose logging ( FirebaseDatabase.DefaultInstance.LogLevel = LogLevel.Verbose; ) gives me:

PersistentConnection:pc_0 - Scheduling connection attempt
ConnectionRetryHelper:Scheduling retry in %dms
PersistentConnection:pc_0 - Trying to fetch auth token

Then after a a min or two:

PersistentConnection:pc_0 - Connection interrupted for: connection_idle

I've tried giving the service account the Owner role and making it DwD. Neither helps.

Has anyone been able to get this working? Do I need to do something special when setting up the service account? Do I need to do something in Firebase after setting up the service account?


Solution

  • I received a response from Firebase after submitting a request for help. They will be including a fix for this problem in their next release.