Angular Authentication and Authorization - The Correct Way

preview_player
Показать описание
Learn Angular authentication and authorization in a single video. Here we will implement registration, login, obtaining a JWT token from the real API and authorization for our Angular application with Angular interceptor.

TIMESTAMPS
0:00 Introduction
0:40 Initial project
1:29 Real API
2:40 Registration
9:58 Angular authentication
11:56 Reading a user
14:57 Getting a user
16:08 Angular authorization
21:17 Logout

MOST POPULAR COURSES

FOLLOW ME

REFERENCES
Рекомендации по теме
Комментарии
Автор

i was waiting for this video, literally i will cry.. i am so happy, please make videos on angular. we have comparatively less good videos for angular in Youtube, i am from India, and now I'm leaning mean stack, but my collogues changed to react and other domain because angular having less resources, so please make more videos on angular, its very helpful for new developers like us.

sanjayms
Автор

Thank you for the lesson, I learned a lot of new information. 👍

yusufakkurt
Автор

very help full with the explanation, i will try to follow this video

nightsurvivor
Автор

Nice vid thank you... I still get a 401 from the ngOnInit... also in your code from github... looks like the interceptor doesn't get triggert? I mean it works but the get still throws an error or is that like normal and ok?

soberstudy
Автор

Very nice video please continue creating videos on different topics in angular 17 ❤

Ashish_Devi
Автор

Dear Olex, could you please explain if there is any specific point you use inject, not DI in a constructor? I'm just a beginner so it's better to develop good habits right from the start.

sfspmusic
Автор

This is good. But for additional security I believe that we can use set-cookie in response and with-credentials header to store and pass token. (If we have control over the backend)

pmsanthosh
Автор

what if i want to store more stuff from the user at the registration like for example their age. and retrieve that as well after login. is that api link good or allows only username, email, password, bio, image?

melanocetjohnsonii
Автор

Hi man, great video. Can you please make a video on new angular 17 project structure? To understand the new default behavior of standalone components throughout the project and also to understand the starting points and lazy loading of routes etc. Already a subscriber :))

ultrawhiff
Автор

Hi. I have a question. When you register, you get a token, what's the use of it? Cause when you log in you will get a new token and save it to localstorage

Cobyboy_x
Автор

Great video! But i don`t understand why You need 'undefined' state for signal? Looks like it can be only 'null | User' state. And in that case You avoid additional request to server. Only check for null or User. Can You explaine?

woumurb
Автор

currently im having a problem when im in home page and i reload it the login page flashes for a moment, why is that? currently i implemented a guard that if the user is not logged in redirect the user to login page if trying to access home page.

allchill
Автор

Sorry the question is not related to the video, is there any way i make observable out of signal which is production ready

MultiWarrr
Автор

Please put subtitle to the courses on your webpage, im hard of hearing and im not purchasing for that reason, also subtitles make it easier to understand to people who don't know english at high level, at least for me it does these two functions. I mean audio transcription is ok, im not asking for traduction, just subtitles. Thanks :)

aarondiaz
Автор

new angualar have but or my pc already dont know, When im writing code in SCSS and for example I write color: ; before I give property to this color angular goes on the error and if I will write after 1 second color: #fff; angular already eat my brain with error wich was one second ago and if I dont ctrl + c and ng serve again code isnot working and goes on the error, Its waste my time and I'm very tired already with it please people give me advice this is my pc problem or Angular have bug.

giorgimindiashvili
Автор

What version of Angular is? why you don't use constractor?

vladazhyguliovtseva
Автор

is there a known issue about angular 17 I created my interceptor and added to config file. I have added some console.logs for test but its not intercepts my http calls. always returns 401 unauthorized after check headers there is no token information added. and of course api returns error : {status: 'error', message: 'missing authorization credentials'}

wdwceev
Автор

Very good video but I wonder if we can create getUser function inside the AuthService ? Isn't this better ?

paweld.
Автор

Great video. Why do you use inject() instead of providing the dependencies to a constructor?

mrluckyuncle
Автор

which editor you are using. it is clean

ShubhamMishra-uwyi