Firebase Security Rules

Firebase Security Rules

If you are using firebase in your android project you may receive an email telling you, You are not safe, you will be stolen from bad guys …

No alt text provided for this image

This is an important email you should keep it in your mind and you must secure your firebase real-time database so how could we do this step

First step you will create any secret key using the next website for example the key you will use is [xyzzEE20] in our project give this key to your developers working on the same project android, ios …etc

You should have a project in your firebase now got to your firebase console and open authentication->Sigin-method and enable Anonymous

No alt text provided for this image

Second step we will add our code to sing-in users Anonymous in our app side

No alt text provided for this image

In your activity or fragment

No alt text provided for this image

Now your app ready to sign-in users to your firebase realtime-database and it will be like next …

No alt text provided for this image

Final step updating your firebase reules like as shown below

No alt text provided for this image

if you have more children you should add them to your Rules to give access to all users logged-in Anonymously, then now you can access your child and take any action [update - delete .. ]… Run your project and have a fun day with your code

You can read this article and see the gists on Medium website.

Any feedback is welcome and appreciated :)





要查看或添加评论,请登录

社区洞察

其他会员也浏览了