Search code examples
androidfirebasefirebase-realtime-databaseandroid-things

How to authenticate to a Firebase database using Android Things?


I am starting to experiment with Android Things and I am trying to connect my app to a Firebase Realtime Database in a secure way.

The problem is that Firebase Authentication is not available in Things because it requires user interaction.

I don't want to leave my data public, so is there a way to authenticate to a Firebase Database using something like an API key?


Solution

  • On Android Things, you can still do anonymous auth and email/password auth. With email/password, you can create a special account for your Thing in the console, and use those credentials to log in. The downside is that you're either baking the password into the Thing, or finding a way to get a hold of them that's somehow more secure.