Authentication in Angular- AuthGuard | CanActivate | Role Auth
Vložit
- čas přidán 12. 06. 2024
- How to implement Authentication and Authorization in Angular. By using AuthGuards we can restrict users to access the routes also we can configure it base on the Role of the user.
We take free Sessions on .Net Full stack training, if you guys are interested then you can join the telegram channel to get all the updates on training session.
Telegram Link: LET'S PROGRAM
t.me/letsprogramYt - Věda a technologie
Every time ur proving that ur a real genius 👌👌
very helpful for me.thank you so much!
Bro really your videos more neat and clear... please post more videos bro... you get more viewers and subscribers.
Thanks you 🙂
Thank you. Good explanation , very clear and precise
You're welcome 🙂
@@letsprogram30 bro can you send this project github link
In which video of yours do you go over JWT with Angular?
Thankyou Bro.awesome and very helpful video. Please make a video on Authentication &Authorization using JWT.Thankyou..
Tnx from Argentina!
Hey, where can I find the whole video, with local storage and the login functions. Thank you so much
Nicely Explained.
awesome explanation .. can you please let me know if it is possible to have 2 can-activate() in1 auth guard
great explanation
Amazing!
The video was very helpful.
Thank you thank you
Do checkout my Blog : letsprogram.in
I have had a lot of experience and training in developing software. I was taught as well as it makes sense to just hide functionality from a user if they do not have access to it. unless some functionality is disabled until a certain condition is met like in the case of a submit button being disabled untill the form fields are valid, it greatly irritates a user when you show functionality that they cant use. Its just a psychological phenomena. So how do I hide things based on a users Role?
you can use *ngIf with some conditions on div
@@blueSurfer Thanks !!!
Which video is the video tht shows u already made the login, main, signup
Keep Gng 💕👌
This is where you realise the hard part ins't coding but thinking your website out
Hello , i have data register in database how i can replace "localstorage.getitem('token') ?
Hi, this is very good one , but this is not matching with you previous login video, Please share git hub repo link.
Hi. Great tutorial! I just have one problem, when a user is on dashboard page and they remove the /dashboard, i want it to not work and take them back to dashboard. How do i do that?
You can use the router Service to navigate to any page that you like
this is awesome, but Can you please tell me If I want to restrict a user from a specific HTML element / typescript method/ function inside the component(some functions/ elements should be accessible but some should not), thank you.
You should use access modifier to achieve this
follow the same tutorial and just add ngif to component u want to hide and call canActivate() like this: *ngIf="authGuard.canActivate()" , also import authguard in component.ts
Sidhi baat no bakwas great. 👌
Haha thanks 🙂
Very Helpful.. Thanks :)
You're welcome 😊
Well explained 🤌
Very good video, can I have the source code please?
but admin can use,
user components, how to deal with that?
Thank YOu 😉
Your welcome 🤗
Hiii....
Can any one help me....???
Reactive form----
Curd...
Select options....
I m not abl to edit and bind the select....
Plz help me..... ☹️☹️☹️☹️
How to create the login which u have created here
what backend stack do you use?
It's just fake creation without backend, just explained about what to do in frontend side
please put this full code in your description
😊😊😊
Where can I find the code?
please can u share the code
hlw sir firstly u have to create a page step by step or u provide code...then this video is usefull
Bro can you please share the source code
Hi brother Really nice video.. can I get access to the code ?
Telegram not to working
This video is only for auth guards, please upload video for whole login functionality
Sure will include that in next video
@@letsprogram30 i hope so
Nice, but I think there is an issue.
User can just put a random invalid jwt token in the localstorage through browser console, and will have access to internal pages.
Rather, it is better to have an async auth guard, that will call the api with the jwt token, and if the token is valid, only then the auth guard will return true.
This is just for the demo purpose where there was no backend involved 🙂
@@letsprogram30 Yeah that makes sense indeed. May be its better to mention about this in your videos though, otherwise people end up making unsecured apps :D
Btw, dont get me wrong, I am just giving feedback from audience POV. Great videos !
@@jeetadhikari3629 I highly appreciate your feedback bro🙂
I will make sure next time to mention the same🙂🙏
Hi, i don't want show about us , contact page to other users. How can I do that?
Just check and store the session who has logged in and you can use *ngIf to hide
Can I do this if i have logged in using json-server ?? Please reply me... I need help
Yes
@@letsprogram30 But I don't have token there .. what should I do ?
How can we hide the about,contactus Component , instead of giving alert ?
Just make use that condition inside the template to hide and show using ngIf
can i make this method with keycloak authentification?
Yes you can
When I clicked logout still the token is present? And it going to main page. Have you faced this and solution please?
On logout method Just do localstorage.clear()
@@letsprogram30 thank you very much for your quick response
@@s.balaji5016 you're welcome 🙂
can u show me full source code for login and signup?
Can you please send me the source code of this
Hello, full project login with CRUD operation. 🙏🙏🙏
I do have video created on above mentioned topics
geat work !! source code please
Source code? for the UI.
The other video was good.
Connect with me on telegram
bro can share you project on github
is there a link to this?
Hi. Where is the code
Please provide entire code
Please add GitHub link also.
Soon I am adding GitHub links for all th videos
@@letsprogram30 hurry up
what backend stack do you use?
It's just fake creation without backend, just explained about what to do in frontend side
@@letsprogram30 oh i see, thank you my friend