Fireship · @fireship
OAuth with Angular and Firebase Tutorial
Uploaded April 18, 2017 · Length 3:18
Summary
build user authentication system with angular and firebase
- angular authentication
- firebase oauth
- angular firebase tutorial
- user login system
- angular fire
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
in this episode we're going to build a
- 0:01
user authentication system with angular
- 0:04
4 and Firebase authentication is
- 0:07
required in almost every angular
- 0:08
application including this basic to-do
- 0:11
list app the app currently has no
- 0:13
authentication at all but we want the
- 0:15
user to be able to log in with their
- 0:16
Google Facebook Twitter or GitHub
- 0:20
account at this point it is assumed that
- 0:23
the angular fire two packages installed
- 0:25
and bootstrapped in your app if not go
- 0:27
to the docs or check out this
- 0:31
[Music]
- 0:33
[Applause]
- 0:35
video we are going to keep this feature
- 0:37
super simple the off service will handle
- 0:40
all the interaction with the Firebase
- 0:42
API the user login component will handle
- 0:45
the log in and log out actions from the
- 0:48
user and the user profile component will
- 0:51
show details about the user that are
- 0:54
returned from
- 0:57
Firebase head over to your Firebase
- 1:00
project and enable the providers you
- 1:02
want to use for non-google providers you
- 1:04
will need to get your own developer
- 1:06
account and API
- 1:08
[Music]
- 1:10
Keys the way you handle authentication
- 1:12
with Firebase is by subscribing to the
- 1:15
angular fire off observable which
- 1:17
returns a Firebase off State object now
- 1:22
that we have the off State object we can
- 1:23
take advantage of typescript accessors
- 1:26
to get
- 1:28
attributes
- 1:33
here's the beauty of Firebase you can
- 1:35
Implement four social off providers with
- 1:37
very little code I start by creating a
- 1:40
reusable private function that takes the
- 1:43
provider as an argument called social
- 1:45
sign
- 1:46
in when a user attempts to sign in two
- 1:49
things can happen success or failure
- 1:52
when it's a success the thin code will
- 1:54
execute and if it's a error the catch
- 1:57
code will execute at this this point you


