How to allow only my app to access firebase without a login?

12,459

Solution 1

Enable Anonymous sing-in provider under Sing-in Method under Authentication tab in your Firebase Console and use firebase anonymous authentication

Solution 2

Firebase Real-Time DB does not allow access to Un-Authorized Users.

Making the Firebase Database Rules true for Read & Write is not the way as (Chintan Soni) said.

So a Authentication mechanism is the best way!

Share:
12,459

Related videos on Youtube

Sourav Kanta
Author by

Sourav Kanta

I am a student of Computer Science Student in IIEST Shibpur, Howrah, India and I am extremely interested in android and website development. You can look me up at : https://sourav-kanta.000webhostapp.com/

Updated on June 04, 2022

Comments

  • Sourav Kanta
    Sourav Kanta almost 2 years

    I am storing my app's data on Firebase and this being my first project on Firebase is proving to be much more difficult than I thought. I have gone through the official documentation and it says that we can login a user with their email and password or use other login options like Google or Facebook etc. However I don't want user's to login to my application but only read and write data to firebase if they are using my app. Right now I am using public rules for my firebase but then anyone with a reference to my firebase URL can read and write to the database. How do I overcome this?

    Thanks in advance.

    • finki
      finki almost 8 years
      What about using anonymous authentication? firebase.google.com/docs/auth/android/anonymous-auth
    • Chintan Soni
      Chintan Soni almost 8 years
      You have already introduced a major threat by making rules Public. Best way to overcome this is to implement Authentication. Period.
    • Avinesh
      Avinesh over 7 years
      @finki what is difference between anonymous authentication and public.
  • Shohrab
    Shohrab almost 7 years
    even if user doesn't have any application key?
  • Zar E Ahmer
    Zar E Ahmer almost 7 years
    Does firebase alows an app to publish with read ,write access without login(authentication)
  • Veeresh Charantimath
    Veeresh Charantimath almost 7 years
    you can use anonymous login
  • atrujillofalcon
    atrujillofalcon about 6 years
    A firebase database can be public. All depends of auth rules.
  • Odin
    Odin almost 6 years
    This approach is for testing purposes only. It's a big security violation if used in production; anyone can read/write your database.
  • Haroun Hajem
    Haroun Hajem about 5 years
    This should not be used in production.
  • Shafqat Kamal
    Shafqat Kamal about 4 years
    i am facing an issue using firebase anonymous authentication. Can you help me with that?
  • Shafqat Kamal
    Shafqat Kamal about 4 years
    I implemented auth into my android app also i have set rules in firebase to protect my firebase project from other app users. But still its not working.