How to make firebase storage only available to users of the app

前端 未结 2 398
挽巷
挽巷 2020-12-06 14:55

I have images saved to my Firebase storage and I only want users using the app to be able to access them. I don\'t want to force my users to login just to use the app, so th

2条回答
  •  半阙折子戏
    2020-12-06 15:02

    Basically you want to change the Rules of your Storage. Under the Firebase console and in Storage there are two tabs in the top of the frame. One that says file and one that says Rules. If you click the Rules tab you will get a view of the code that defines who can read and write to and from your storage. You will want to follow the link below to set up the correct rules for your storage. But based on what you want all you have to do is set the read write code to be:

     allow read: if request.auth != null;
    

    Check out this link: https://firebase.google.com/docs/storage/security/user-security

提交回复
热议问题