Fireship · @fireship
Firebase Google SignIn + Firestore w/ Angular
Uploaded January 11, 2019 · Length 11:13
Summary
Implement Google OAuth via Firebase in an Angular app, saving custom user data in Firestore and enabling full-stack security.
- firebase google sign in
- angular firebase
- firestore database
- full stack security
- google oauth
- angular services
- rxjs operators
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
a single most important feature for many
- 0:08
apps is the user authentication system
- 0:10
if you don't have a good way to sign-in
- 0:12
users and observe their data it's hard
- 0:14
to build out anything else in today's
- 0:16
video we'll implement Google OAuth via
- 0:18
firebase in an angular app in addition
- 0:20
we'll save custom information about the
- 0:22
user in the firestore database and we'll
- 0:24
implement full stack security on both
- 0:26
the front end and the back end so by the
- 0:28
end of this video you should have a
- 0:29
solid off system that you can build on
- 0:31
if you're new here like and subscribe
- 0:33
and you can find the full source code on
- 0:34
fire ship io and I'd like to quickly
- 0:37
point out that this is the first episode
- 0:39
with the new fire ship io channel name
- 0:41
but this video is actually a revision of
- 0:43
episode 55 from angular firebase over
- 0:45
the next few months I'll be revising and
- 0:47
updating a lot of that content so if
- 0:49
there's anything you want to see me
- 0:50
revisit let me know in the comments to
- 0:52
get started with this lesson you'll need
- 0:53
to have an angular app with angular fire
- 0:55
and firebase installed you can find full
- 0:57
instructions for that on the main lesson
- 0:59
page first we'll go into our firebase
- 1:01
project and under the authentication tab
- 1:03
we'll enable the Google sign-in method
- 1:05
from there we'll go ahead and enable
- 1:07
fire store and for now we'll leave the
- 1:09
security rules unlocked but we'll circle
- 1:11
back around to this at the end of the
- 1:12
video to secure the backend when we sign
- 1:15
in a user with firebase it's going to
- 1:16
create this authentication record but
- 1:18
it's very limited and we can't easily
- 1:20
customize it the important thing that it
- 1:22
gives us is a unique user ID which we
- 1:24
can use to model relational data in fire
- 1:26
store for example you might have a has
- 1:29
one relationship where a user has an
- 1:30
account and we can easily model that in
- 1:32
the database by just giving the document
- 1:34
itself the same user ID as the
- 1:36
authentication record now we'll jump
- 1:38
into angular and write some code that
- 1:39
can read write and react to this data in
- 1:41
real time your user authentication logic
- 1:44
and state is something that you'll be
- 1:46
managing globally so you'll want to have
- 1:48
it organized as an angular service so we
- 1:50
can go ahead and generate it with the
- 1:52
angular CLI by running ng generate
- 1:54
service and I'm putting it inside of a
- 1:56
services directory now before we get
- 1:59
into the service itself there's one


