Fireship · @fireship
Firebase Database Rules Tutorial
Uploaded June 20, 2017 · Length 5:13
Summary
Learn how to set up Firebase Database security rules to control data access and validation.
- firebase database rules
- firebase security
- firebase authentication
- database security
- data validation
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
security is a critical concern for any
- 0:03
web application a secure app must
- 0:05
prevent unauthorized database operations
- 0:07
as well as validate the integrity of
- 0:10
incoming data firebase allows you to
- 0:13
define database security logic and a
- 0:16
JSON file that corresponds to the
- 0:18
structure of your database the no sequel
- 0:21
database is essentially just a series of
- 0:23
nodes and each node can have its own
- 0:26
validation and security rules for
- 0:29
example you might have some data that's
- 0:31
accessible to everybody that visits the
- 0:33
site or you might have some data that
- 0:35
should only be accessed by authenticated
- 0:38
users or other data that's only
- 0:40
accessible to the user that created it
- 0:42
and this lesson I'm going to go through
- 0:43
all these different scenarios and show
- 0:45
you how to implement these or Squier
- 0:47
based database rules you can define
- 0:50
firebase rules directly from your
- 0:51
angular project or from the firebase
- 0:54
clone form personally I prefer using the
- 0:56
firebase console because you can send
- 0:58
test requests to make sure that your
- 1:00
rules are working properly there are
- 1:03
three types of rules you can set read
- 1:05
write and validate read controls access
- 1:08
to data write controls the ability to
- 1:12
create edit or delete data and validate
- 1:16
control format of data you can use any
- 1:19
combination of these rules together or
- 1:21
none of them at all there's also a
- 1:23
series of variables that give you access
- 1:25
to firebase resources auth gives you
- 1:29
access to the user authentication state
- 1:31
roof gives you access to the root note
- 1:34
of the database data gives you access to
- 1:37
the data as it appears before the
- 1:40
operation takes place new data shows you
- 1:42
how the data will appear after an
- 1:44
operation takes place now gives you the
- 1:47
UNIX timestamp for the current time
- 1:50
there is also a wild card variable that
- 1:53
you can use to reference any child key
- 1:55
throughout the database now let's run
- 1:58
through some of the most common security
- 1:59
scenarios Google might run into first we


