0

on sample android application to access database Firebase (https://www.firebase.com/docs/android/quickstart.html), we just need to write

Firebase myFirebaseRef = new Firebase("https://<YOUR-FIREBASE-APP>.firebaseio.com/");

The problem is, if someone know my firebase url "https://.firebaseio.com/", they will be able to manipulate my data from their application. How to secure connect to Firebase? like a facebook or Google Api give us APP-Key or Secret. -Thank You

rey1024
  • 99
  • 3
  • 8

3 Answers3

3

Step 7 in the quickstart you linked:

Secure Your Data

Use our powerful expression-based Security and Firebase Rules to control access to your data and validate input:

{
  ".read": true,
  ".write": "auth.uid === 'admin'",
  ".validate": "newData.isString() && newData.val().length < 500"
}

Firebase enforces your Security and Firebase Rules consistently whenever data is accessed. The rules language is designed to be both powerful and flexible, so that you can maintain fine-grained control over your application's data.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
2

Firebase security is not based on API keys/secret but in permission rules. Check this out.

Héctor
  • 24,444
  • 35
  • 132
  • 243
2

So if you want to make everything only writable you add the following security rule:

{ "rules": { ".read": false, ".write": true } }

And it is also worth noting that these rules will cascade to all child nodes and you cannot override them in child nodes except for validation rules.

Jukka Puranen
  • 8,026
  • 6
  • 27
  • 25