Restrict Firebase database access to one Android app

后端 未结 2 924
太阳男子
太阳男子 2020-12-11 00:52

I\'m working on an Android app that reads from a Firebase database. App users won\'t be logging in or modifying the database. All app users will be looking at the same dat

相关标签:
2条回答
  • 2020-12-11 01:09

    When you add your application to Firebase project, you must specify SHA1 certificate of your app, so nobody is able to access your data except you.

    0 讨论(0)
  • 2020-12-11 01:11

    3. Use FirebaseAuth and signInAnonymously() method

    reference: https://firebase.google.com/docs/auth/android/anonymous-auth

    Then adjust security rules:

        {
          "rules": {
            ".read": "auth != null",
            ...
          }
        }
    

    Con: multiple accounts used only for reading the same data

    0 讨论(0)
提交回复
热议问题