javascript - How can I secure Firebase with an all client-side implementation? - Stack Overflow

I have a very simple Firebase app that is being read and written to via JavaScript all on the client-si

I have a very simple Firebase app that is being read and written to via JavaScript all on the client-side. There are no user accounts or server-side applications on my end.

Right now, anyone looking at my JavaScript can copy my Firebase URL and have full read/write access permissions.

Is there any easy way for me to secure this somehow considering I'm doing everything on the client side?

I'm having trouble understanding their documentation and how I can solve this use case.

I have a very simple Firebase app that is being read and written to via JavaScript all on the client-side. There are no user accounts or server-side applications on my end.

Right now, anyone looking at my JavaScript can copy my Firebase URL and have full read/write access permissions.

Is there any easy way for me to secure this somehow considering I'm doing everything on the client side?

I'm having trouble understanding their documentation and how I can solve this use case.

Share Improve this question asked Sep 4, 2015 at 16:58 RalphRalph 5171 gold badge6 silver badges16 bronze badges 1
  • Security rules! firebase./docs/security – Kato Commented Sep 4, 2015 at 18:58
Add a ment  | 

1 Answer 1

Reset to default 9

Data access is managed through Firebase's security rules language, that you can find in the Security & Rules tab of your Firebase dashboard.

When you create a new Firebase backend for an app, it defaults to allowing full read/write to everyone.

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

The simplest possible change is to allow everyone to read, but no-one to write:

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

This way you can only make changes to the data when you're an administrator, i.e. when you're using the Firebase dashboard.

The Firebase documentation has an entire section dedicated to securing your data.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745215988a4617022.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信